0
votes

I wrote a JavaScript program to just query table in Snowflake. I saved the file with .js extension.

While executing .js file through git Bash(node filename.js) I am getting following error:

Syntax Error: Invalid or unexpected token
?[90m    at wrap Safe (internal/modules/cjs/loader.js:1047:16)?[39m
?[90m    at Module._compile (internal/modules/cjs/loader.js:1097:27)?[39m
?[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:1
0)?[39m
?[90m    at Module.load (internal/modules/cjs/loader.js:977:32)?[39m
?[90m    at Function.Module._load (internal/modules/cjs/loader.js:877:14)?[39m
?[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_ma
in.js:74:12)?[39m
?[90m    at internal/main/run_main_module.js:18:47?[39m

Could anyone please help me in resolving this issue.

1
Welcome to StackOverflow! Please read how to ask. If you have a Syntax error provide the code snippet where the error occurs.Gerd K

1 Answers

0
votes

internal/modules/cjs/loader.js

This error appears to be at a very early point of execution, where the program input (filename.js contents) gets loaded and interpreted. This error is unrelated to the use of Snowflake's connector library.

The Invalid or unexpected token indicates that it found an unacceptable keyword or character that's considered illegal in JavaScript syntax.

This is just a further guess on the above, but if you've used a non-standard code editor, such as TextEdit.app, Notepad, Microsoft Word, etc. to write your code, then there's a good chance they injected smart quotes (), or smart dashes () in place of plain ASCII quotes (") or dashes (-). Also see this past question for further ideas on what the bad characters (or encoding) could be: node.js SyntaxError: Invalid or unexpected token

It'd also be of help if you can upload a small code sample that reproduces your issue.