-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VS Code attaches to wrong port when using process picker #37985
Comments
What you are seeing is the expected behaviour. The process picker is used to attach to a node process by process ID, not by port. But in your case the node.js is explicitely started with So using the attach config for port If you really want to use a process picker, then make sure that the processes you want to pick are not started with the |
@weinand But the port number changes every time, it seems to be random. So you have to change the config every time which is really annoying. Why not add the feature to the process picker that if it detects the |
The connection between the process picker and the node-debugger is via a launch config variable Could you try to configure a fixed port for |
You could have a special case where the return value I'm not sure how you configure a port for |
The connection between the process picker command and the node-debugger is based on the generic concept of textual variable substitution. That does not support to substitute different attributes in a launch config. I suggest to continue the discussion here: #3201 |
I'm trying to do multi-target debugging. I use a Launch configuration to launch my master process and then use
cluster.fork
to fork a child process. I then try to start an "Attach to process" debug session, and I pick the forked process (one of whose arguments is--inspect-port=17130
. After 10 seconds I get the error:Ensure Node was launched with --inspect. Cannot connect to runtime process, timeout after 10000 ms - (reason: Cannot connect to the target: connect ECONNREFUSED 127.0.0.1:9229).
It tried to connect to port 9229, and unsurprisingly it didn't work. If I manually set up a launch configuration to attach to port
17130
it works, but why can't the process picker figure out it needs that port?The text was updated successfully, but these errors were encountered: