Debugger on VSCode for NodeJS stopped working today. It was working fine until late last week.
I couldn’t directly upload the gif on StackOverflow (apparently the image is above the size limit) you can refer to the gif in the following link:
I recorded a short video (in .gif format) of what happens when I try to start debugging. The video shows that when running debugger, it launches, the debug buttons show up for a moment then shuts down with no error messages.
I’ve upgraded my VSCode from 1.94.0 to 1.95.2 late last week so I tried reinstalling the old version (1.94.0) but the same issue occurs.
The node version I am using is v23.2.0 and npm version is 10.9.0.
I’ve tried turning on "trace": true in launch.json and couldn’t find any major issues or reasons as to why debug didn’t run:
{"tag":"dap.receive","timestamp":1731889683832,"metadata":{"connectionId":6,"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","supportsProgressReporting":true,"supportsInvalidatedEvent":true,"supportsMemoryReferences":true,"supportsArgsCanBeInterpretedByShell":true,"supportsMemoryEvent":true,"supportsStartDebuggingRequest":true,"supportsANSIStyling":true},"type":"request","seq":1}},"level":0}
{"tag":"dap.send","timestamp":1731889683832,"metadata":{"connectionId":6,"message":{"seq":1,"type":"response","request_seq":1,"command":"initialize","success":true,"body":{"supportsConfigurationDoneRequest":true,"supportsFunctionBreakpoints":false,"supportsConditionalBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsEvaluateForHovers":true,"supportsReadMemoryRequest":true,"supportsWriteMemoryRequest":true,"exceptionBreakpointFilters":[{"filter":"all","label":"Caught Exceptions","default":false,"supportsCondition":true,"description":"Breaks on all throw errors, even if they're caught later.","conditionDescription":"error.name == "MyError""},{"filter":"uncaught","label":"Uncaught Exceptions","default":false,"supportsCondition":true,"description":"Breaks only on errors or promise rejections that are not handled.","conditionDescription":"error.name == "MyError""}],"supportsStepBack":false,"supportsSetVariable":true,"supportsRestartFrame":true,"supportsGotoTargetsRequest":false,"supportsStepInTargetsRequest":true,"supportsCompletionsRequest":true,"supportsModulesRequest":false,"additionalModuleColumns":[],"supportedChecksumAlgorithms":[],"supportsRestartRequest":true,"supportsExceptionOptions":false,"supportsValueFormattingOptions":true,"supportsExceptionInfoRequest":true,"supportTerminateDebuggee":true,"supportsDelayedStackTraceLoading":true,"supportsLoadedSourcesRequest":true,"supportsLogPoints":true,"supportsTerminateThreadsRequest":false,"supportsSetExpression":true,"supportsTerminateRequest":false,"completionTriggerCharacters":[".","[",""","'"],"supportsBreakpointLocationsRequest":true,"supportsClipboardContext":true,"supportsExceptionFilterOptions":true,"supportsEvaluationOptions":false,"supportsDebuggerProperties":false,"supportsSetSymbolOptions":false,"supportsANSIStyling":true}}},"level":0}
{"tag":"dap.send","timestamp":1731889683836,"metadata":{"connectionId":6,"message":{"seq":2,"type":"event","event":"initialized","body":{}}},"level":0}
{"tag":"dap.receive","timestamp":1731889683840,"metadata":{"connectionId":6,"message":{"command":"launch","arguments":{"type":"pwa-node","name":"Launch Program","request":"launch","trace":{"stdio":true,"logFile":"c:\Users\dkim1\AppData\Roaming\Code\logs\20241118T132057\window5\exthost\ms-vscode.js-debug\vscode-debugadapter-6344ce95.json.gz"},"outputCapture":"console","timeout":10000,"timeouts":{},"showAsyncStacks":true,"skipFiles":["<node_internals>/**"],"smartStep":true,"sourceMaps":true,"sourceMapRenames":true,"pauseForSourceMap":false,"resolveSourceMapLocations":["C:\Temp\testapp/**/*.(m|c|)js","!**/node_modules/**"],"rootPath":"C:\Temp\testapp","outFiles":["C:\Temp\testapp/**/*.(m|c|)js","!**/node_modules/**"],"sourceMapPathOverrides":{"webpack:///./~/*":"c:\Temp\testapp/node_modules/*","webpack:////*":"/*","webpack://@?:*/?:*/*":"c:\Temp\testapp/*","webpack://?:*/*":"c:\Temp\testapp/*","webpack:///([a-z]):/(.+)":"$1:/$2","meteor://💻app/*":"c:\Temp\testapp/*","turbopack://[project]/*":"C:\Temp\testapp/*"},"enableContentValidation":true,"cascadeTerminateToConfigurations":[],"enableDWARF":true,"__workspaceFolder":"c:\Temp\testapp","__breakOnConditionalError":false,"cwd":"c:\Temp\testapp","env":{},"envFile":null,"localRoot":null,"remoteRoot":null,"autoAttachChildProcesses":true,"runtimeSourcemapPausePatterns":[],"program":"C:\Temp\testapp\app.js","stopOnEntry":false,"console":"internalConsole","restart":false,"args":[],"runtimeExecutable":"node","runtimeVersion":"default","runtimeArgs":[],"profileStartup":false,"attachSimplePort":null,"experimentalNetworking":"auto","killBehavior":"forceful","__configurationTarget":6,"__workspaceCachePath":"c:\Users\dkim1\AppData\Roaming\Code\User\workspaceStorage\03d089070aa5db2fbfa2943c367e5f14\ms-vscode.js-debug","__sessionId":"18328475-2be9-474c-864f-9a638a80a8a6"},"type":"request","seq":2}},"level":0}
{"tag":"dap.send","timestamp":1731889683840,"metadata":{"connectionId":6,"message":{"seq":3,"type":"event","event":"output","body":{"category":"telemetry","output":"js-debug/launch","data":{"type":"pwa-node","request":"launch","os":"win32 x64","nodeVersion":"v20.16.0","adapterVersion":"1.94.0","parameters":"{"type":"pwa-node","name":"<string>","request":"launch","trace":{"stdio":true,"logFile":"<string>"},"outputCapture":"console","timeout":10000,"timeouts":{},"showAsyncStacks":true,"skipFiles":["<string>"],"smartStep":true,"sourceMaps":true,"sourceMapRenames":true,"pauseForSourceMap":false,"resolveSourceMapLocations":["<string>","<string>"],"rootPath":"<string>","outFiles":["<string>","<string>"],"sourceMapPathOverrides":{"webpack:///./~/*":"<string>","webpack:////*":"<string>","webpack://@?:*/?:*/*":"<string>","webpack://?:*/*":"<string>","webpack:///([a-z]):/(.+)":"<string>","meteor://💻app/*":"<string>","turbopack://[project]/*":"<string>"},"enableContentValidation":true,"cascadeTerminateToConfigurations":[],"enableDWARF":true,"__workspaceFolder":"<string>","__breakOnConditionalError":false,"cwd":"<string>","env":{},"envFile":null,"localRoot":null,"remoteRoot":null,"autoAttachChildProcesses":true,"runtimeSourcemapPausePatterns":[],"program":"<string>","stopOnEntry":false,"console":"internalConsole","restart":false,"args":[],"runtimeExecutable":"node","runtimeVersion":"default","runtimeArgs":[],"profileStartup":false,"attachSimplePort":null,"experimentalNetworking":"auto","killBehavior":"forceful","__configurationTarget":6,"__workspaceCachePath":"<string>","__sessionId":"<string>"}"}}}},"level":0}
{"tag":"dap.send","timestamp":1731889683841,"metadata":{"connectionId":6,"message":{"seq":4,"type":"event","event":"output","body":{"category":"console","output":"Verbose logs are written to:nc:\Users\dkim1\AppData\Roaming\Code\logs\20241118T132057\window5\exthost\ms-vscode.js-debug\vscode-debugadapter-6344ce95.json.gzn"}}},"level":0}
{"tag":"dap.receive","timestamp":1731889683843,"metadata":{"connectionId":6,"message":{"command":"setBreakpoints","arguments":{"source":{"name":"app.js","path":"c:\Temp\testapp\app.js"},"lines":[1],"breakpoints":[{"line":1}],"sourceModified":false},"type":"request","seq":3}},"level":0}
{"tag":"dap.receive","timestamp":1731889683844,"metadata":{"connectionId":6,"message":{"command":"setExceptionBreakpoints","arguments":{"filters":[],"filterOptions":[]},"type":"request","seq":4}},"level":0}
{"tag":"dap.send","timestamp":1731889683844,"metadata":{"connectionId":6,"message":{"seq":5,"type":"response","request_seq":3,"command":"setBreakpoints","success":true,"body":{"breakpoints":[{"id":1,"verified":false,"message":"Unbound breakpoint"}]}}},"level":0}
{"tag":"dap.send","timestamp":1731889683844,"metadata":{"connectionId":6,"message":{"seq":6,"type":"response","request_seq":4,"command":"setExceptionBreakpoints","success":true,"body":{}}},"level":0}
{"tag":"dap.receive","timestamp":1731889683859,"metadata":{"connectionId":6,"message":{"command":"configurationDone","type":"request","seq":5}},"level":0}
{"tag":"dap.send","timestamp":1731889683859,"metadata":{"connectionId":6,"message":{"seq":7,"type":"response","request_seq":5,"command":"configurationDone","success":true,"body":{}}},"level":0}
{"tag":"dap.receive","timestamp":1731889683860,"metadata":{"connectionId":6,"message":{"command":"threads","type":"request","seq":6}},"level":0}
{"tag":"dap.send","timestamp":1731889683860,"metadata":{"connectionId":6,"message":{"seq":8,"type":"response","request_seq":6,"command":"threads","success":true,"body":{"threads":[]}}},"level":0}
{"tag":"runtime.launch","timestamp":1731889683923,"message":"Using binary at","metadata":{"location":"C:\Program Files\nodejs\node.exe","executable":"node"},"level":1}
{"tag":"runtime.launch","timestamp":1731889683972,"message":"Discovered version","metadata":{"version":"v23.2.0"},"level":1}
{"tag":"dap.send","timestamp":1731889684038,"metadata":{"connectionId":6,"message":{"seq":9,"type":"event","event":"output","body":{"category":"console","output":"C:\Program Files\nodejs\node.exe .\app.jsn"}}},"level":0}
{"tag":"runtime.launch","timestamp":1731889684045,"message":"Launched successfully","metadata":{"name":"Yl"},"level":1}
{"tag":"dap.send","timestamp":1731889684045,"metadata":{"connectionId":6,"message":{"seq":10,"type":"response","request_seq":2,"command":"launch","success":true,"body":{}}},"level":0}
{"tag":"dap.receive","timestamp":1731889684084,"metadata":{"connectionId":6,"message":{"command":"breakpointLocations","arguments":{"source":{"name":"app.js","path":"c:\Temp\testapp\app.js"},"line":1},"type":"request","seq":7}},"level":0}
{"tag":"dap.send","timestamp":1731889684084,"metadata":{"connectionId":6,"message":{"seq":11,"type":"response","request_seq":7,"command":"breakpointLocations","success":true,"body":{"breakpoints":[]}}},"level":0}
{"tag":"dap.send","timestamp":1731889684160,"metadata":{"connectionId":6,"message":{"seq":12,"type":"event","event":"terminated","body":{"restart":false}}},"level":0}
{"tag":"dap.receive","timestamp":1731889684163,"metadata":{"connectionId":6,"message":{"command":"disconnect","arguments":{"restart":false,"terminateDebuggee":false},"type":"request","seq":8}},"level":0}
{"tag":"dap.send","timestamp":1731889684163,"metadata":{"connectionId":6,"message":{"seq":13,"type":"response","request_seq":8,"command":"disconnect","success":true,"body":{}}},"level":0}
My launch.json file is as follows:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\app.js",
"trace": true
}
]
}
2
Answers
To elaborate, VSCode debugger is not attaching with NodeJS 23.3.0. There is a ticket https://github.com/microsoft/vscode/issues/235023
I've downgraded to NodeJS v22.12.0 (LTS) and it works. Cheers.
It seems to be a bug in 23.2.0 and 23.3.0, it works fine on 23.1.0 for me.