Node JS Debugger not hitting breakpoints

For some reason, the debugger isn't hitting my breakpoints. I've made a very simple test application to explain this issue:

 

index.js

console.log("Hello")

 

A breakpoint is added onto the one and only line in Index.js. I create the following debug configuration:

 

 

Running the debug runs the file absolutely fine (I get the "Hello" output). But it doesn't stop at the breakpoint. 

0
14 comments

strange, it definitely works for me using same setup. What IDEA version do you use? Try adding more console.log() lines with breakpoints - do any of them work? Please also attach a screenshot of your debug console while debugging, so that I xcan see what is logged there

0
Avatar
Permanently deleted user

IDEA version:

IntelliJ IDEA 2018.3.5 (Ultimate Edition)
Build #IU-183.5912.21, built on February 26, 2019
JRE: 1.8.0_152-release-1343-b28 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.2

 

More logs:

 

 

Debug console:

 

0
Avatar
Permanently deleted user

Oh bloody hell. I was pressing the green "Play" button, not the "Debug" button....

 

I'm an idiot.

0

I see, thanks for update:)

0
Avatar
Permanently deleted user

Thanks for responding. I guess I'm still trying to get used to the IntelliJ layout after VSCode :-)

1

From today I have this problem using the new version

IntelliJ IDEA 2020.1 (Ultimate Edition)

macOS 10.15.4

1

Please could you elaborate on this issue? is it a project-specific (i.e. can you reproduce it with basic Node.js apps)? What Node.js version do you use? Please also share a screenshot of Node.js debug console

0

I have same issue here after I updated IDEA to 2020.1. It seems that debugger does not even start and goes straight into run.  It worked without any issues in IDEA 2019.

Tried to debug the same project in Webstorm 2020.1 - everything works well, debugger starts and stops on breakpoints.

Reproduced on any node.js projects, even simple one line console.log("hello") script.  

 

Debugger console in Webstorm shows debugger starting:

 

Debugger console in IDEA doesn't show this and goes straight into execution

0

Yes, this is it. Thank you, will watch the issue for updates

 

0

I confirm, without the GO plugin, the debugger works correctly

1

My issue was that I've had 

NODE_OPTIONS='--max-old-space-size=7000'

in the Environment variables section of my run configuration. That prevented the debugger from connecting.

1

Yes, this can indeed be the issue - NODE_OPTIONS environment variable is used by the debugger for automatic connection to child processes, so redefining NODE_OPTIONS breaks the debugger. As a workaround you can append your arguments to it: NODE_OPTIONS="$NODE_OPTIONS --max-old-space-size=7000"

 

0

Thank you Elena Pogorelova. Your workaround saved my day :)

0

Please sign in to leave a comment.