Sylvain
Sylvain

Reputation: 113

Breakpoints are not hit when debugging Node JS app in VS Code

I don't know if I am missing something but I can't manage to debug this very simple Node JS program with VS Code (I'm on a Ubuntu env) :

Code

When I start debugging, my breakpoint is "set but not yet bound". The strange thing is that the execution will stop on exceptions if I ask it to, but it will NEVER stop on my breakpoints.

My launch.json file is as follows :

launch.json

Thank you for your answers.

Upvotes: 4

Views: 3211

Answers (1)

Sylvain
Sylvain

Reputation: 113

I found a workaround. There is a bug on breakpoints in VS Code and to get it work :

  1. Write an exception on your code at the beginning
  2. Debug your app. It should stop on the exception
  3. While it is stopped on the exception, set your breakpoints
  4. Remove the exception code
  5. The next time you debug, breakpoints should be hit !

Upvotes: 2

Related Questions