Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 348
Sylvain Avatar asked Oct 28 '25 08:10

Sylvain


1 Answers

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 !
like image 143
Sylvain Avatar answered Oct 31 '25 00:10

Sylvain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!