Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
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

Closed

Description

@roblourens

From Petr Plenkov (@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

Activity

  1. roblourens commented on Dec 10, 2017

    @roblourens
    MemberAuthor

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

    In this file you can already set breakpoints.

  2. roblourens commented on Dec 10, 2017

    @roblourens
    MemberAuthor

    There are two issues with this:

  3. roblourens commented on Dec 10, 2017

    @roblourens
    MemberAuthor

    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.

  4. roblourens commented on Dec 10, 2017

    @roblourens
    MemberAuthor

    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.

  5. changed the title [-]Cannot debug mjs modules[/-] [+]Can't hit early breakpoints when debugging with --experimental-modules and .mjs[/+] on Dec 10, 2017
  6. jpike88 commented on Mar 15, 2018

    @jpike88

    nodejs/node#18194

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

  7. roblourens commented on Mar 15, 2018

    @roblourens
    MemberAuthor

    Thanks

  8. locked and limited conversation to collaborators on Apr 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions