Repository navigation
Debugger isn't stopped at the debugger; statement when debugging using --inspect #10457
Description
Activity
- addedinspectorIssues and PRs related to the V8 inspector protocol.Issues and PRs related to the V8 inspector protocol.questionIssues asking questions about Node.js.Issues asking questions about Node.js.
on Dec 26, 2016 debugger;statements are supported bynode --inspect. However, they are ignored until the debugger is connected. You probably have to use the--debug-brkflag as well to pause the application at the start and have the time to open the developer tools.Reacted by Marco Celotti, Lukas Knuth, Helder S Ribeiro, Felix Jamestin, Roman Nikitchenko, Chris Aslanoglou, YiFanChen99, Spencer Smith, Meiko Honma and Bryan HoangReacted by Helder S RibeiroGot it, thanks! So in this case
$ node debug myscript.jsthe debugger is connected immediately so that I don't need to pass--debug-brk, correct?$ node debugis not using the inspector protocol.@eugeneo, so is my understanding correct that if
--inspectis used, thedebugger;statements are ignored until the debugger is connected. However, if$ node debugis used, the inspector protocol is not used, and debugger is stopped at thedebugger;statements even before the debugger is connected?Update on this. The flag has changed recently to
--inspect-brk. So:node --inspect-brkReacted by Troy Patrick, Nick McKinnon, Neil Graham, Sebastian Simon, Thomas O'Brien and Bryan HoangHi max i had the same issue. I tried "node inspect app.js" to start the debugger using the inspector protocol without the two dashes "--" and it worked. I used the chrome devtools with chrome://inpsect
Reference: https://nodejs.org/api/debugger.html -- node -v v12.19.0
Hi max i had the same issue. I tried "node inspect app.js" to start the debugger using the inspector protocol without the two dashes "--" and it worked. I used the chrome devtools with chrome://inpsect
Reference: https://nodejs.org/api/debugger.html -- node -v v12.19.0
Things work differently between
node --inspectandnode inspect, see docs here. Bothnode --inspectandnode inspectwill set up an inspector agent for debugging but the latter one will enable Node CLI as a inspector client. On the other hand the former one doesn't arrange a specific debugger, which could be devtools or your IDE, for you. Therefore there might be some underlyings mechanics related to inspector clients that cause the difference you mentioned, after all in your scenario, devtools isn't the first debugger that connect to your inspector agent but Node CLI is.Reacted by Dzmitry Karneyenka
v6.9.2:
Windows10 x64:
When debugging with Chrome using
$ node --inspect filenamefeature described here, the debugger isn't stopped at thedebugger;statement as stated in the same manualfor the
$ node debug filenamefeature.Is behavior different for the
--inspectfeature anddebugger;statement is not supported?