vscode: Auto Attach is not toggling for Node.js since latest update
- VSCode Version: 1.47.2
- OS Version: Windows 10 v1909 (Build 18363.959)
Steps to Reproduce:
I use WSL to start VSCode with code .
from my project directory in Windows Terminal. When VSCode starts up, “Auto Attach: Off” is shown in the status bar:
Clicking “Auto Attach: Off” in the status bar does not toggle it.
I then start my project in VSCode’s integrated terminal with npm run debug
, which corresponds to the following scripts
line in package.json
:
"scripts": {
"debug": "NODE_ENV=development DEBUG='knex:*' nodemon --inspect ./server.js"
}
However, the debugger is not auto-attached, so I need to manually run the Attach
configuration from the Run panel shown on the left here:
The debugger works, but I still cannot toggle the Auto Attach: Off
to be On instead:
Even if I Ctrl+Shift+P --> Debug: Toggle Auto Attach
, nothing happens. Even if I restart VSCode after doing so.
So, in conclusion, how can I start my VSCode with code .
from Windows Terminal and then just type npm run debug
and have VSCode, run my program AND auto-attach the debugger? I also need the server to restart upon file changes, which is why I am using nodedemon
in the npm run debug
script.
Do I need to either:
-
change
launch.json
configuration? Though I have tried essentially all of the boilerplatelaunch.json
configs shown in VSCode, but none worked. -
or modify my
package.json
definedscript
fordebug
? -
or correct some setting on VSCode?
Does this issue occur when all extensions are disabled?: Yes
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 37 (18 by maintainers)
@msanandrea BTW, the “protocol” and “sourceMaps” properties are no longer necessary…
@msanandrea your problem is https://github.com/microsoft/vscode/issues/102873#issuecomment-674999289