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

debug doesn't work on node v6 #6029

Closed
Mirodil opened this issue May 2, 2016 · 12 comments
Closed

debug doesn't work on node v6 #6029

Mirodil opened this issue May 2, 2016 · 12 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues important Issue identified as high-priority upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Milestone

Comments

@Mirodil
Copy link

Mirodil commented May 2, 2016

  • VSCode Version: 1.0.0
  • OS Version: Windows 10

Steps to Reproduce:

  1. install node v6
  2. generate express application
  3. open the app folder with vscode
  4. open console and run node --debug bin\www
  5. attache to node process with vscode
  6. set break point to users.js:line:6
  7. and navigate in the web browser to '/users'

it works with node v5.10

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority debug Debug viewlet, configurations, breakpoints, adapter issues labels May 2, 2016
@bpasero
Copy link
Member

bpasero commented May 2, 2016

@weinand @isidorn fyi, node 6 was just released last week with V8 50.

@isidorn isidorn assigned weinand and unassigned isidorn May 2, 2016
@isidorn
Copy link
Contributor

isidorn commented May 2, 2016

@weinand mentioned that we have not yet tested node v6 and that he is planning to take a look once he is back from vacation. I think Andre is back from vacation this week so forwarding to him.

@weinand weinand added this to the May 2016 milestone May 4, 2016
@weinand weinand changed the title debug doesn't works on node v6 debug doesn't work on node v6 May 4, 2016
@egamma egamma mentioned this issue May 4, 2016
87 tasks
@Mirodil
Copy link
Author

Mirodil commented May 9, 2016

the same issue with NodeJS v6.1.0 and VSCode 1.1.0

@weinand
Copy link
Contributor

weinand commented May 9, 2016

@Mirodil are you debugging node v6 with VS Code 1.1 in 'attach' mode? If yes, please launch node with --debug-brk instead of --debug. Does it make a difference?

@Mirodil
Copy link
Author

Mirodil commented May 9, 2016

yes, it works with --debug-brk flag

@weinand
Copy link
Contributor

weinand commented May 9, 2016

@Mirodil thanks for trying. Here is the explanation:

VS Code injects code into node.js to work around slowness issues with large data structures. For reasons we do not yet understand this injected code fixes the issue in node v6 that requesting the call stack results in an "Internal error: illegal access" error.
VS Code injects the code with an 'evaluate' request.
The injected code uses a require(...) which is only available if node is stopped. This is only the case if node is started with --debug-brk.
If only --debug is used, code injection fails and our magic 'fix' cannot work.

We hope that the node v6 issue will be eventually fixed.

@Mirodil
Copy link
Author

Mirodil commented May 9, 2016

thank you, I got it

@weinand
Copy link
Contributor

weinand commented May 10, 2016

Node-inspector has the same issue: node-inspector/node-inspector#864

Since code injection fixes the issue for the --debug-brk case, we only have to find a way to inject code when node has been started with --debug.

I've verified that debugging node v6 works in VS Code 1.1 if node has been started with --debug-brk.

@weinand weinand added the upstream Issue identified as 'upstream' component related (exists outside of VS Code) label May 10, 2016
@stevehipwell
Copy link

+1

@weinand
Copy link
Contributor

weinand commented May 10, 2016

I found a way to inject code into a node.js started with --debug. This fixes the initial problem.
The fix will be available in VS Code - alpha.

@matthiasg
Copy link

It is possible there is still an issue when a 'proxied' accessor method is used ?
I have VSC 1.7.1 and node 6.9.1 on Win10 x64 and whenever i debug onto a call accessing a proxied getter function the debugger just halts. Calling the getter in the Debug Console outputs illegal access.

Normal running of the code with attached debugger works fine.

@weinand
Copy link
Contributor

weinand commented Nov 15, 2016

@matthiasg yes, proxies are a problem with the old node debugger of VS Code. Please try the new node debugger by using the debug type "node2" in your launch config.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
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 debug Debug viewlet, configurations, breakpoints, adapter issues important Issue identified as high-priority upstream Issue identified as 'upstream' component related (exists outside of VS Code) verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants