NodeJS Debugging stuck at "Debugger attached." on Win 10, across multiple installs.

I'm having a persistent issue debugging NodeJS on Windows 10 that's persisted across several Windows re-installs. I hit debug, and it just does nothing after outputting "Debugger attached." (I've left it hours before, so it's not down to impatience). This also happens across different projects, even the simplest project consisting of a JS file with a single `console.log("Hello")` has seen this happen.

It's also intermittent. I'd say it happens about 2/3 of the time I hit debug. Usually if I restart debugging a few times, it'll work eventually, though sometimes it'll randomly decide to take over 20 restarts to work.

This is with NodeJS installed from the official installer (V10), and installed through the Windows version of NVM (V10 and V12).

When booted into Linux, I can debug these same codebases just fine on the same computer. I've tried deleting my ".WebStorm20xx.x" folder in case there was some bad configuration, to no avail. I've deleted the ".idea" folders in the codebases to no avail.

I don't know if my google-fu has failed me or not, but I've been unable to find posts anywhere about anything similar.

 

So... Any ideas?

10 comments
Comment actions Permalink

Must be https://youtrack.jetbrains.com/issue/WEB-40496; the issue indeed looks specific to Windows environment, but it's intermittent: for me, it never occurs on first run, only on re-running, and it works 9 times out of 10. But other users reporting it are less lucky:(

1
Comment actions Permalink

Looks like I might have to move over to Linux for the time being then :(

0
Comment actions Permalink

Please try disabling js.debugger.use.node.options key in Registry (Help | Find action, type Registry to locate it) -does it make things any better?

0
Comment actions Permalink

Thanks! Disabled that, tried restarting the debugger 30 or so times, and it worked every time. So this is an issue with the move away from using the NODE_OPTIONS env variable?

0
Comment actions Permalink

By default (with the registry key enabled), the IDE uses NODE_OPTIONS (https://medium.com/the-node-js-collection/node-options-has-landed-in-8-x-5fba57af703d) for debug port management; when it's disabled, the --inspect-brk=<port> is passed explicitly

0
Comment actions Permalink

I have the same problem with intellij ultimate 2019.1 on macOS 10.14.6. I have found that closing intellij and reopening it solves the issue, but the issue re-occurs every time I launch my code in debug mode. So, I have to close/re-open intellij each time I launch my application in debug mode. Reading the previous comments; Is there a way to disable js.debugger.use.node.options in macOS?

0
Comment actions Permalink

Upgraded to 2019.2.3 and still have the same issue.

0
Comment actions Permalink

js.debugger.use.node.options Registry key is not OS-specific, instructions for disabling it are the same for all OSs - see https://intellij-support.jetbrains.com/hc/en-us/community/posts/360006009360/comments/360000810019

0
Comment actions Permalink

Well it works.. thanks !

 

0
Comment actions Permalink

Just had the issue out of a sudden (2020.3.1) and disabling the option makes it work but now I am unable to set breakpoints @Elena Pogorelova. I had to upgrade to Node 15.

0

Please sign in to leave a comment.