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.
Please sign in to leave a comment.
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
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:
Oh bloody hell. I was pressing the green "Play" button, not the "Debug" button....
I'm an idiot.
I see, thanks for update:)
Thanks for responding. I guess I'm still trying to get used to the IntelliJ layout after VSCode :-)
From today I have this problem using the new version
IntelliJ IDEA 2020.1 (Ultimate Edition)
macOS 10.15.4
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
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
Do you have GO plugin installed? Must be https://youtrack.jetbrains.com/issue/WEB-44721
Yes, this is it. Thank you, will watch the issue for updates
I confirm, without the GO plugin, the debugger works correctly
My issue was that I've had
in the Environment variables section of my run configuration. That prevented the debugger from connecting.
Yes, this can indeed be the issue -
NODE_OPTIONS
environment variable is used by the debugger for automatic connection to child processes, so redefiningNODE_OPTIONS
breaks the debugger. As a workaround you can append your arguments to it:NODE_OPTIONS="$NODE_OPTIONS --max-old-space-size=7000"
Thank you Elena Pogorelova. Your workaround saved my day :)