简体   繁体   中英

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?

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.

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.

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.

For me the issue was that WebStorm didn't play well with my typescripts. It would say debugger listening and then run through the entire program without stopping at the breakpoint as described in the question.

The workaround I used was to simply put the breakpoint in compiled js file and debug from there instead.

  1. Go to Run -> View Breakpoints... or hit shift + command + F8 in OS X.
  2. Select your breakpoint from the list and make sure Suspend is checked.

启用暂停

Fixed the issue by enabling generation of 'map' file in the TypeScript configuration. Add '--sourceMap' in Tools-->Languages & Frameworks-->TypeScript-->Options

I'm having the same issue in version 2022.2 but I don't think it is a problem with the version

Here are the potential solutions;


Go to;

WebStorm -> Preference -> Build, Execution, Deployment -> Debugger

Click " Allow unsigned requests " checkbox and make it checked

This solved my issue.


Or

Check your local environment. What I mean by saying check your local environment is usually more than one service is trying to use the same debugger port if we speak about the eg nodejs.

You will get the following message if you try to run two services at the same time in the debug mode;

Starting inspector on 127.0.0.1:9229 failed: address already in use

Try to start the main service first that you try to debug.

disabling js.debugger.use.node.options in the webstorm registry helped me

https://youtrack.jetbrains.com/issue/WEB-47774#focus=Comments-27-4436526.0-0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM