Skip to content
This repository has been 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

Closed
roblourens opened this issue Dec 10, 2017 · 6 comments
Assignees
Labels

Comments

@roblourens
Copy link
Member

From @ThePlenkov on December 9, 2017 9:7

Hi,

I hope I chose the correct place to create the issue.

I'm trying to debug mjs node file but the breakpoints are just ignored.

Please see attached gif file.
2017-12-09_10-04-31

This is my configuration:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Test JSDOM",
            "program": "${workspaceFolder}/jsdom.mjs",
            "runtimeArgs": [
                "--experimental-modules"
            ]
        }
    ]
}

Do I do something wrongly or it's just not supported yet?

Thank you!

Copied from original issue: microsoft/vscode-node-debug#167

@roblourens
Copy link
Member Author

From @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:
image

In this file you can already set breakpoints.

@roblourens
Copy link
Member Author

There are two issues with this:

@roblourens
Copy link
Member Author

From @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
Copy link
Member Author

@roblourens the problem is that VS Code debugger even doesn't
stop on debugger statement, not only on start.

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.

@jpike88
Copy link

jpike88 commented Mar 15, 2018

nodejs/node#18194

Node 9.6.0 solves this issue. Request that this issue be closed

@roblourens
Copy link
Member Author

Thanks

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants