Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webstorm debugger breakpoints doesn't work in nodejs

When I try to set a breakpoint and debug the file, the debugger just run the app without stopping at breakpoints. This is my code:

console.log('123');

And this is my output:

/usr/bin/node --debug-brk=39765 --nolazy index.js
debugger listening on port 39765
123

Process finished with exit code 0

Does anyone has an idea what could be the problem?

like image 413
someone235 Avatar asked Jun 01 '15 23:06

someone235


3 Answers

Try to disable js.debugger.v8.use.any.breakpoint in WebStorm registry.

You can do it by going to Help -> Find Action

In there just enter Registry.

For me disabling this option made debugging anything node-related much faster and much more predictable.

like image 160
Piotr Dabrowski Avatar answered Oct 24 '22 01:10

Piotr Dabrowski


Wanted to chime in and say that it is absolutely critical that you use --debug-brk and not --debug with getting WebStorm breakpoints to work for remote debugging as well as running the server directly from webstorm.

Even though --debug-brk technically just stops and waits for the debugger to join, and --debug allows you to join later, my breakpoints failed with just --debug no matter the remote configuration I tried.

As far as I can tell, connecting WebStorm 11 to a node.js server on the debug port, with only --debug, will connect but fail to load any breakpoints that work.

like image 22
Luciano Avatar answered Oct 24 '22 01:10

Luciano


Debug breakpoints not work in my PhpStorm 2016.3.2 with NodeJS 7.7.x. My expectation is, that WebStorm will have same issue.

If you downgrade to Node 6 (I tested with 6.9.4), it starts working correctly.

like image 34
Martin Avatar answered Oct 24 '22 02:10

Martin