Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
Debugging js files with VS Code

I'm new to javascript.

I'm trying to debug the simple program:

console.log("Hello World!\n"); // this line has a breakpoint

let million = 1_000_000;
console.log(million);

However, when I press the play button in the debug section, I get:

Process exited with code 1
Uncaught SyntaxError SyntaxError: Invalid or unexpected token
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

Most likely node.js hasn't implemented the "_" notation for numbers. Despite that, the error message I'm seeing seems more like messages from a bad build from C++ (we even get a code error 1), than a bad script in a higher level.

Is there a way to make this output more like a higher level language, like python, where with the traceback would point us to the file and line of the error? Also, why is it that the debugger is not stopping at the breakpoint?

P.S.: When a press the dropdown arrow in the debug terminal, I get the message No debugger available, can not send 'variables'.

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Well, to solve this issue, I had to create a launch.json file (not sure how), and then I added "console": "integratedTerminal" to it.

So, when we launch the program, in the integrated vscode terminal we'll get the error message with some extra information:

let million = 1_000_000;
              ^

After solving this error, the debug will work almost as expected, except for the behaviour of the step-into button.

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!