Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Npm scripts explorer: cannot debug node versions < 8.0 #48552

Closed
weinand opened this issue Apr 24, 2018 · 1 comment
Closed

Npm scripts explorer: cannot debug node versions < 8.0 #48552

weinand opened this issue Apr 24, 2018 · 1 comment
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@weinand
Copy link
Contributor

weinand commented Apr 24, 2018

testing #48354:

  • use nvm which 7.10.1 to find the path to a node executable of a pre-8.0 version of node
  • create an npm script that uses this version of node, e.g.
    "debug": "/Users/weinand/.nvm/versions/node/v7.10.1/bin/node --debug-brk hello.js"
  • in npm script explorer select the new script and run the context menu action "Debug" on it

Observe: debugger times out after 10 seconds.

I've debugged this on the VS Code side and the problem is a missing "protocol": "legacy" attribute in the launch config passed to vscode.debug.startDebugging. Without that the debugger assumes the "inspector" protocol.

I suggest to always pass the "protocol" attribute. Use a value of "inspector" when detecting a "inspect" option and a value of "legacy" when detecting a "debug" option in the npm script.

@weinand weinand added the bug Issue identified by VS Code Team member as probable bug label Apr 24, 2018
@egamma
Copy link
Member

egamma commented Apr 25, 2018

@thanks for tracking this down!

egamma added a commit that referenced this issue Apr 25, 2018
@egamma egamma closed this as completed Apr 25, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants