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

Debugger not working for npm tasks #30629

Closed
Yahkob opened this issue Jul 13, 2017 · 8 comments
Closed

Debugger not working for npm tasks #30629

Yahkob opened this issue Jul 13, 2017 · 8 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues

Comments

@Yahkob
Copy link

Yahkob commented Jul 13, 2017

  • VSCode Version:Version 1.14.0 (1.14.0)
  • OS Version: El Capitan 10.11.6

Steps to Reproduce:

  1. Create npm task in .vscode
{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch via NPM",
            "cwd": "${workspaceRoot}",
            "runtimeExecutable": "npm",
            "runtimeArgs": [
                "run-script", "dev"
            ],
            "port": 5858
        }
    ]
}
  1. Configure package.json script
    "dev": "node --debug-brk -- /Users/yahkob/myApp/index.js",

  2. make simple index file

module.exports = (function () {
  console.log('hi')
  setTimeout(() => {
    console.log('stuff')
  },120000)
})();

after running I get Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: Parse Error).

@vscodebot vscodebot bot added new release debug Debug viewlet, configurations, breakpoints, adapter issues labels Jul 13, 2017
@Yahkob
Copy link
Author

Yahkob commented Jul 13, 2017

Just confirmed rolling back from 1.14 -> 1.13 fixes this

@weinand
Copy link
Contributor

weinand commented Jul 13, 2017

from the VS Code 1.14 release notes:

In this release, Node.js debugging will assume the "inspector" protocol whenever the runtimeExecutable attribute of a launch configuration is set. If you see your debug configurations failing, this change could be the reason. To fix this, you can either upgrade Node.js to version 8.x or you can explicitly force the use of the "legacy" protocol by adding "protocol": "legacy" to your launch configuration.

@weinand weinand closed this as completed Jul 13, 2017
@Yahkob
Copy link
Author

Yahkob commented Jul 13, 2017

Thanks @weinand some how missed that :)

@weinand
Copy link
Contributor

weinand commented Jul 13, 2017

I hope that my guess is correct... :-)

@Yahkob
Copy link
Author

Yahkob commented Jul 13, 2017

Will try and confirm here later @weinand .

@fattydevelop
Copy link

it works for me. 👍
release 1.14.1

@Yahkob
Copy link
Author

Yahkob commented Jul 20, 2017

Yep can confirm changing to use "protocol": "legacy" fixed my issue thanks @weinand

@rob3c
Copy link

rob3c commented Sep 21, 2017

The legacy protocol setting fixed my issue, as well.

There's already a message printed to the console that says "Debugging with inspector protocol because a runtime executable is set." Why not add a note there about the legacy protocol setting for when the affected devs are actually hitting the problem, instead of burying it in the release notes and closed issues? I shudder to think of the cumulative time wasted across all devs for breaking changes like this.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues
Projects
None yet
Development

No branches or pull requests

4 participants