Skip to content

Support nodemon development setup by adding support to automatically re-attach when node is restarted #3238

@joaomoreno

Description

@joaomoreno

Issue: #2103
Assignees:

Setting the new launch config attribute restart to true makes node-debug to automatically restart the session if the debug target has terminated. This is useful if you use nodemon to restart node on file changes.

Setup:

  • on the command line start your node (server) program like this:
nodemon --debug server.js
  • in VS Code create this attach launch config:
{
    "name": "Attach",
    "type": "node",
    "request": "attach",
    "port": 5858,
    "restart": true
}
  • Now 'Attach' in VS Code.

Test:

  • Verify that VS Code always restarts the debug session successfully after nodemon has restarted node.
  • Test the behaviour if the session is stopped in VS Code or nodemon is killed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions