From 860b3c25a63acd78a621893704ab82cf2120b9d9 Mon Sep 17 00:00:00 2001 From: NikhilPal2468 <60142488+NikhilPal2468@users.noreply.github.com> Date: Thu, 11 Jan 2024 15:15:57 +0530 Subject: [PATCH] TypeError: BigQuery is not a constructor fixed --- bigquery.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bigquery.js b/bigquery.js index 6d2b4da..7f51b0d 100644 --- a/bigquery.js +++ b/bigquery.js @@ -84,14 +84,14 @@ module.exports = function(RED) { // We do not have a static query try { const results = await bigquery.query(query); + msg.payload = results[0]; + node.send(msg); } catch(error) { node.error('Error, unable to execute query.'); return; } - msg.payload = results[0]; - node.send(msg); } // Input if (credentials) { @@ -118,4 +118,4 @@ module.exports = function(RED) { RED.nodes.registerType(NODE_TYPE, BigQueryNode); -}; \ No newline at end of file +};