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

Javascript debugger not working #172906

Closed
AlCalzone opened this issue Jan 31, 2023 · 10 comments
Closed

Javascript debugger not working #172906

AlCalzone opened this issue Jan 31, 2023 · 10 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@AlCalzone
Copy link

Does this issue occur when all extensions are disabled?: Yes, but this needs the JS debugger

  • VS Code Version: 1.74.3
  • OS Version: Ubuntu 22.04.1 LTS

Steps to Reproduce:

// file: test.js
debugger;
console.log("after debugger"); // put breakpoint here
  1. execute node test.js in Javascript debug console
  2. notice that "after debugger" is logged, debugger does not attach

alternatively add this launch config:

		{
			"name": "Test Program",
			"program": "${workspaceFolder}/test.js",
			"request": "launch",
			"skipFiles": ["<node_internals>/**"],
			"type": "node"
		},
  1. run it
  2. debugger does not launch, program exits at the end
@AlCalzone
Copy link
Author

I'm starting to think this may be system or configuration related. I went all the way back to 1.66.2 (and I've definitely debugged this way last summer), yet the debugger does not attach.

@AlCalzone
Copy link
Author

AlCalzone commented Jan 31, 2023

Even with auto-attach set to "always", nothing happens here:
ezgif com-gif-maker

@AlCalzone
Copy link
Author

AlCalzone commented Jan 31, 2023

Tested on a different machine with Windows 10 instead of Ubuntu, here it works.
Also tested inside a devcontainer on the Ubuntu machine, here it works too.
So this must be something env-specific, but I have no idea what.

@roblourens roblourens assigned connor4312 and unassigned roblourens Jan 31, 2023
@connor4312
Copy link
Member

What is the result of echo $NODE_OPTIONS in the JavaScript Debug Terminal?

@connor4312 connor4312 added the info-needed Issue requires more information from poster label Jan 31, 2023
@AlCalzone
Copy link
Author

AlCalzone commented Jan 31, 2023

Devcontainer (working):

--require /vscode/vscode-server/bin/linux-x64/97dec172d3256f8ca4bfb2143f3f76b503ca0534/extensions/ms-vscode.js-debug/src/bootloader.bundle.js --inspect-publish-uid=http

Ubuntu (not working):

--require /usr/share/code/resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js --inspect-publish-uid=http

Windows (with git bash, working):

--require "c:/Users/domin/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/ms-vscode.js-debug/src/bootloader.bundle.js" --inspect-publish-uid=http

@connor4312
Copy link
Member

What version of Node.js are you using in the "not working" sample?

@AlCalzone
Copy link
Author

16.19.0

The devcontainer is on 18.13.0 and the Windows machine on 12.x or 14.x

@connor4312
Copy link
Member

Do you have any capabilities set on your Node binary? You may be hitting nodejs/node#37588

@AlCalzone
Copy link
Author

sudo getcap $(which node)
/usr/bin/node cap_net_bind_service,cap_net_admin,cap_net_raw=eip

that might be it

@AlCalzone
Copy link
Author

That was it! Thanks for the pointers, removing the capabilities fixed it.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants