Debugger not stopping on breakpoints
See original GitHub issueHey! I’m having issues similar to https://github.com/microsoft/vscode/issues/103048, wanted to create a new issue so I’m not hijacking threads, it seemed like some people over there were having issues with NPM script arguments which is definitely unrelated for me.
Describe the bug When the preview is enabled (now default), no breakpoints, debuggers, or initial breaks are hit. The program runs and exits with code 0 (if the node event loop is clear).
To Reproduce Ubuntu 18.04, Using NVM globally, Node binary at 14.3.0, VSCode at 1.47.2, all built-in plugins enabled.
Code used is a single file to keep it insanely simple.
debugger;
console.log(1);
debugger;
Launch config, used just the default one and added a stopOnEntry
and trace
:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"stopOnEntry": true,
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/index.js",
"trace": true
}
]
}
Steps to reproduce the behavior:
- Create a new folder, place the above JS in it with a launch config.
- Run the launch program debug profile.
- Observe no breakpoints are hit.
Log File
{"timestamp":1595779628477,"tag":"runtime.welcome","level":1,"message":"js-debug v1.47.5 started","metadata":{"os":"linux x64","nodeVersion":"v12.8.1","adapterVersion":"1.47.5"}}
{"tag":"dap.receive","timestamp":1595779628469,"metadata":{"connectionId":1,"message":{"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"pwa-node","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-us","supportsProgressReporting":true},"type":"request","seq":1}},"level":0}
{"tag":"dap.send","timestamp":1595779628470,"metadata":{"connectionId":1,"message":{"seq":1,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsConfigurationDoneRequest":true,"supportsFunctionBreakpoints":false,"supportsConditionalBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsEvaluateForHovers":true,"exceptionBreakpointFilters":[{"filter":"caught","label":"Caught Exceptions","default":false},{"filter":"uncaught","label":"Uncaught Exceptions","default":false}],"supportsStepBack":false,"supportsSetVariable":true,"supportsRestartFrame":true,"supportsGotoTargetsRequest":false,"supportsStepInTargetsRequest":false,"supportsCompletionsRequest":true,"supportsModulesRequest":false,"additionalModuleColumns":[],"supportedChecksumAlgorithms":[],"supportsRestartRequest":true,"supportsExceptionOptions":false,"supportsValueFormattingOptions":true,"supportsExceptionInfoRequest":true,"supportTerminateDebuggee":false,"supportsDelayedStackTraceLoading":true,"supportsLoadedSourcesRequest":true,"supportsLogPoints":true,"supportsTerminateThreadsRequest":false,"supportsSetExpression":false,"supportsTerminateRequest":false,"completionTriggerCharacters":[".","[","\"","'"],"supportsBreakpointLocationsRequest":true,"supportsClipboardContext":true}}},"level":0}
{"tag":"dap.send","timestamp":1595779628470,"metadata":{"connectionId":1,"message":{"seq":2,"type":"event","event":"initialized","body":{}}},"level":0}
{"tag":"dap.receive","timestamp":1595779628474,"metadata":{"connectionId":1,"message":{"command":"launch","arguments":{"type":"pwa-node","request":"launch","name":"Launch Program","stopOnEntry":true,"skipFiles":["<node_internals>/**"],"program":"/home/jdelgado/repos/forks/test/index.js","trace":true,"cwd":"/home/jdelgado/repos/forks/test","logFilePath":"/home/jdelgado/.config/Code/logs/20200726T085802/exthost1/ms-vscode.node-debug/debugadapter-legacy.txt","__debuggablePatterns":["*.js","*.es6","*.jsx","*.mjs"],"__workspaceFolder":"/home/jdelgado/repos/forks/test","__sessionId":"e5094630-9ddd-46d7-af99-49b2c16b80bd"},"type":"request","seq":2}},"level":0}
{"tag":"dap.send","timestamp":1595779628475,"metadata":{"connectionId":1,"message":{"seq":3,"type":"event","event":"output","body":{"category":"telemetry","output":"js-debug/launch","data":{"type":"pwa-node","request":"launch","os":"linux x64","nodeVersion":"v12.8.1","adapterVersion":"1.47.5","parameters":"{\"type\":\"pwa-node\",\"name\":\"<string>\",\"request\":\"launch\",\"trace\":true,\"outputCapture\":\"console\",\"timeout\":10000,\"showAsyncStacks\":true,\"skipFiles\":[\"<string>\"],\"smartStep\":true,\"sourceMaps\":true,\"pauseForSourceMap\":false,\"resolveSourceMapLocations\":[\"<string>\",\"<string>\"],\"rootPath\":\"<string>\",\"outFiles\":[\"<string>\",\"<string>\"],\"sourceMapPathOverrides\":{\"webpack://?:*/*\":\"<string>\",\"webpack:///./~/*\":\"<string>\",\"meteor://💻app/*\":\"<string>\"},\"__workspaceFolder\":\"<string>\",\"__autoExpandGetters\":false,\"cwd\":\"<string>\",\"env\":{},\"envFile\":null,\"localRoot\":null,\"remoteRoot\":null,\"autoAttachChildProcesses\":true,\"runtimeSourcemapPausePatterns\":[],\"program\":\"<string>\",\"stopOnEntry\":true,\"console\":\"internalConsole\",\"restart\":false,\"args\":[],\"runtimeExecutable\":\"node\",\"runtimeVersion\":\"default\",\"runtimeArgs\":[],\"profileStartup\":false,\"logFilePath\":\"<string>\",\"__debuggablePatterns\":[\"<string>\",\"<string>\",\"<string>\",\"<string>\"],\"__sessionId\":\"<string>\"}"}}}},"level":0}
{"tag":"dap.send","timestamp":1595779628475,"metadata":{"connectionId":1,"message":{"seq":4,"type":"event","event":"output","body":{"category":"console","output":"Verbose logs are written to:\n/tmp/vscode-debugadapter-0.json.gz\n"}}},"level":0}
{"tag":"runtime.launch","timestamp":1595779628486,"message":"Using binary at","metadata":{"location":"/home/jdelgado/.nvm/versions/node/v14.3.0/bin/node","executable":"node"},"level":1}
{"tag":"dap.receive","timestamp":1595779628493,"metadata":{"connectionId":1,"message":{"command":"setBreakpoints","arguments":{"source":{"name":"index.js","path":"/home/jdelgado/repos/forks/test/index.js"},"lines":[1,2],"breakpoints":[{"line":1},{"line":2}],"sourceModified":false},"type":"request","seq":3}},"level":0}
{"tag":"dap.send","timestamp":1595779628494,"metadata":{"connectionId":1,"message":{"seq":5,"type":"response","request_seq":3,"command":"setBreakpoints","success":true,"body":{"breakpoints":[{"id":1,"verified":false,"message":"Unbound breakpoint"},{"id":2,"verified":false,"message":"Unbound breakpoint"}]}}},"level":0}
{"tag":"runtime.launch","timestamp":1595779628494,"message":"Discovered version","metadata":{"version":"v14.3.0"},"level":1}
{"tag":"dap.send","timestamp":1595779628502,"metadata":{"connectionId":1,"message":{"seq":6,"type":"event","event":"output","body":{"category":"console","output":"/home/jdelgado/.nvm/versions/node/v14.3.0/bin/node /home/jdelgado/repos/forks/test/index.js"}}},"level":0}
{"tag":"runtime.launch","timestamp":1595779628509,"message":"Launched successfully","metadata":{"name":"v"},"level":1}
{"tag":"dap.send","timestamp":1595779628509,"metadata":{"connectionId":1,"message":{"seq":7,"type":"response","request_seq":2,"command":"launch","success":true,"body":{}}},"level":0}
{"tag":"dap.send","timestamp":1595779628531,"metadata":{"connectionId":1,"message":{"seq":8,"type":"event","event":"output","body":{"category":"stderr","output":""}}},"level":0}
{"tag":"dap.send","timestamp":1595779628531,"metadata":{"connectionId":1,"message":{"seq":9,"type":"event","event":"output","body":{"category":"stderr","output":"Process exited with code 0\r\n"}}},"level":0}
{"tag":"dap.send","timestamp":1595779628531,"metadata":{"connectionId":1,"message":{"seq":10,"type":"event","event":"terminated","body":{}}},"level":0}
{"tag":"dap.receive","timestamp":1595779628539,"metadata":{"connectionId":1,"message":{"command":"setExceptionBreakpoints","arguments":{"filters":[]},"type":"request","seq":4}},"level":0}
{"tag":"dap.send","timestamp":1595779628539,"metadata":{"connectionId":1,"message":{"seq":11,"type":"response","request_seq":4,"command":"setExceptionBreakpoints","success":true,"body":{}}},"level":0}
{"tag":"dap.receive","timestamp":1595779628558,"metadata":{"connectionId":1,"message":{"command":"loadedSources","type":"request","seq":5}},"level":0}
{"tag":"dap.send","timestamp":1595779628558,"metadata":{"connectionId":1,"message":{"seq":12,"type":"response","request_seq":5,"command":"loadedSources","success":true,"body":{"sources":[]}}},"level":0}
{"tag":"dap.receive","timestamp":1595779628562,"metadata":{"connectionId":1,"message":{"command":"disconnect","arguments":{"restart":false},"type":"request","seq":6}},"level":0}
{"tag":"dap.send","timestamp":1595779628563,"metadata":{"connectionId":1,"message":{"seq":13,"type":"response","request_seq":6,"command":"disconnect","success":true,"body":{}}},"level":0}
{"tag":"dap.receive","timestamp":1595779628566,"metadata":{"connectionId":1,"message":{"command":"configurationDone","type":"request","seq":7}},"level":0}
{"tag":"dap.send","timestamp":1595779628566,"metadata":{"connectionId":1,"message":{"seq":14,"type":"response","request_seq":7,"command":"configurationDone","success":true,"body":{}}},"level":0}
{"tag":"dap.receive","timestamp":1595779628567,"metadata":{"connectionId":1,"message":{"command":"breakpointLocations","arguments":{"source":{"name":"index.js","path":"/home/jdelgado/repos/forks/test/index.js"},"line":1},"type":"request","seq":8}},"level":0}
{"tag":"dap.send","timestamp":1595779628567,"metadata":{"connectionId":1,"message":{"seq":15,"type":"response","request_seq":8,"command":"breakpointLocations","success":true,"body":{"breakpoints":[]}}},"level":0}
{"tag":"dap.receive","timestamp":1595779628567,"metadata":{"connectionId":1,"message":{"command":"breakpointLocations","arguments":{"source":{"name":"index.js","path":"/home/jdelgado/repos/forks/test/index.js"},"line":2},"type":"request","seq":9}},"level":0}
{"tag":"dap.send","timestamp":1595779628567,"metadata":{"connectionId":1,"message":{"seq":16,"type":"response","request_seq":9,"command":"breakpointLocations","success":true,"body":{"breakpoints":[]}}},"level":0}
VS Code Version: 1.47.2
Additional context
- Disabling the preview causes everything to work as expected. Definitely related to the new version.
- I am not using NPM scripts etc, this is directly debugging a file via profile.
- Attaching to a script and not launching it is still working. My launch configuration for that project:
{
"type": "node",
"request": "attach",
"name": "Docker",
"address": "localhost",
"port": 9230,
"restart": true,
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
},
- I noticed when looking into other submitted trace files that I’m missing an “args” array for the
"command":"launch"
line. I’m unsure if that is related. I’m just using the default launch configuration which the readme specified should work, so I’m not confident in that assessment.
Please let me know if I can provide any further information or test an assumed fix. Thanks for all the work you guys/gals put into projects like this!
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
That is very weird. Thank you for digging around in it. I’ve opened a bug on Node to make sure they’re aware of it; since it seems installation-dependent, we can’t be sure whether it’s fixed on recent versions.
"Can't find Node.js binary "node". Make sure Node.js is installed and in your PATH, or set the "runtimeExecutable" in your launch.json
using the same launch config as above. Setting"runtimeExecutable": "/home/jdelgado/.nvm/versions/node/v14.3.0/bin/node",
resolved it. I doubt this is related but just wanted to report it. I assume this is some OS-level NVM thing, I could still dowhich node
successfully in zsh and bash.EDIT: When I reverted back to the non-nightly, I had the same problem with the executable, so definitely not related to this specific issue.
Once I got past that, I got the same result on the nightly version, it just didn’t specify the exit code. Here is the trace:
Where “1” is the program’s test console.log.