You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Can't hit early breakpoints when debugging with --experimental-modules and .mjs #158
Activity
roblourens commentedon Dec 10, 2017
From Petr Plenkov (@ThePlenkov) on December 9, 2017 11:49
What is interesting. If to put breakpoint into the classic JS module it stops there. And then you can go back.
But in this case you have a different file:

In this file you can already set breakpoints.
roblourens commentedon Dec 10, 2017
There are two issues with this:
--experimental-modulesflag: --inspect-brk does not work with ESM nodejs/node#17340roblourens commentedon Dec 10, 2017
From Petr Plenkov (@ThePlenkov) on December 10, 2017 0:43
roblourens the problem is that VS Code debugger even doesn't
stop on debugger statement, not only on start.
The workaround now is like this:
I run from terminal
node --inspect --experimental-modules jsdom.mjs
It automatically starts chrome dev tools with my mjs module. (NIM extesnsion do the magic) So finally I develop in VS Code and debug in Chrome.
I find a very valuable feature opportunity to debug mjs directly from VS Code.
roblourens commentedon Dec 10, 2017
That's because we start Node in a paused state, then attach. Right now it will skip right over the debugger statement before we are able to attach.
Debugging in Chrome devtools should give a similar experience except for #157.
I will move this bug to the right repo and keep it open to track the upstream issue in Node.
[-]Cannot debug mjs modules[/-][+]Can't hit early breakpoints when debugging with --experimental-modules and .mjs[/+]jpike88 commentedon Mar 15, 2018
nodejs/node#18194
Node 9.6.0 solves this issue. Request that this issue be closed
roblourens commentedon Mar 15, 2018
Thanks