Node debugging extremely slow on startup and after first breakpoint
See original GitHub issueDescription
ExpressJS application becomes unresponsive for a long time whenever VSCode debugger is attached to the application.
The application works as expected and starts up instantly when run normally in a terminal (node dist/server.js
) or using node default debugger (node inspect dist/server.js
). Just a note that the Express JS application in context here isn’t super resource intensive, just some basic CRUD operations and debugging experience on VSCode on other low specs Linux machines is seamless and has no such issue.
The issue only occurs whenever VSCode’s debugger is attached to the application, be it in any form (launch configuration, javascript debug terminal or node process attach).
Here is the full debugging scenario for more context on the issue
- If the application is launched using the launch configuration the application won’t start instantly (i.e. if I goto
localhost:3000
the browser will stuck loading for 2-3 mins), it eventually starts and the first breakpoint is hit but once I step forward in the debugger nothing happens and I have to wait 1-2 mins to reach the next line, after that the debugger works normally. So the main issue is the unresponsive behaviour on attaching debugger and after step over the first breakpoint. - Now if I start the application normally in the terminal, it starts working the browser almost instantly, now once I attach VSCode debugger to the node process and hit any of the application endpoint it hangs and I’ll have to wait for the debugger to hit the first breakpoint, and then again wait after stepping forward from the first breakpoint. After this things work normally without any waiting times.
To Reproduce
- Run an express JS application with the following run configurations
{
"configurations": [
// for scenario 2 listed above
{
"name": "Attach by Process ID",
"processId": "${command:PickProcess}",
"request": "attach",
"skipFiles": [
"<node_internals>/**",
"${workspaceFolder}/node_modules/**/*.js",
],
"sourceMaps": true,
"trace": true,
"type": "pwa-node"
},
// for scenario 1 listed above
{
"type": "pwa-node",
"request": "launch",
"name": "Debug with watch task",
"skipFiles": [
"<node_internals>/**",
"${workspaceFolder}/node_modules/**/*.js"
],
"program": "${workspaceFolder}/dist/server.js",
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"sourceMaps": true,
"trace": true,
"preLaunchTask": "tsc: watch - tsconfig.json"
}
]
}
Log File
- Log file for scenario 1 listed above vscode-debugadapter-f1751c97.json.gz
- Log file for scenario 2 listed above vscode-debugadapter-07d46764.json.gz
VS Code Version:
Version: 1.63.2
Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3
Date: 2021-12-15T09:38:17.605Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin arm64 21.2.0
Additional context Machine Specs
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:10 (3 by maintainers)
Top GitHub Comments
Does this issue go away if you remove
${workspaceFolder}/node_modules/**/*.js
from yourskipFiles
?👀