Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda