Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

don't set runtime debug options when port attribute is specified #98

Closed

Description

while testing the MERN tour microsoft/vscode#22277:

node2 exhibits different behaviour when a "port" attribute is specified.

Here is the use case:

I want to create a launch config that uses a locally installed "nodemon" (from the node_modules folder of the project). For this I have to make sure that the "--debug=12345" argument is not passed as a runtime argument to the first instance of node that runs 'nodemon' but that is is passed as an argument to the nodemon.js program (which passes it to the second instance of node).

So the difference is basically this:

node nodemon.js --debug=12345 test.js

instead of:

node --debug=12345 nodemon.js test.js

According to the documentation this can be achieved by specifying an explicit "port" attribute:

If you specify a debug port via the port attribute, VS Code will not automatically add the --debug-brk=nnnn attribute because the debug port is typically specified by the npm script or other tool as well.

A corresponding launch config that works for 'legacy' is this:

{
	"type": "node",
	"request": "launch",
	"name": "Launch Program",
	"runtimeArgs": [
		"${workspaceRoot}/node_modules/nodemon/bin/nodemon.js",
                "--debug=12345"
	],
	"program": "${workspaceRoot}/test.js",
	"port": 12345
},

This results in the following command:

node ...nodemon.js --debug-brk=12345 index.js 

With 'inspector' the result is:

node --inspect=12345 --debug-brk ...nodemon.js --debug-brk=12345 index.js

So the problem is that node-debug2 adds the "--inspect=12345 --debug-brk" to the runtime arguments even if a port is specified.

Activity

  1. changed the title [-]don't set debug options when port attribute is specified[/-] [+]don't set runtime debug options when port attribute is specified[/+] on Apr 10, 2017
  2. locked and limited conversation to collaborators on Mar 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions