Closed otowncaleb closed 6 months ago
This configuration works for attaching to the Node process but the debugger dies on save, presumably due to Nodemon killing the process and starting a new one. Setting restart: true
doesn't work, again presumably because it tries to attach to the old process instead of the new one.
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Node: Nodemon",
"processId": "${command:PickProcess}"
}
]
}
npm run debug
omg I can't believe it's that simple...
Is this behaviour documented somewhere in VS Code docs?
Is there a way to attach a debugger to a running Node process, such that the debugger re-attaches itself when Nodemon restarts the process on save?
The current recipe recommends an
attach
configuration but provides only alaunch
configuration. It seems theattach
configuration was removed in order to fix #273.It would be nice to have an
attach
configuration for those who wish to start the app in a terminal and run/attach the VS Code debugger only when needed.