Vscode-js-debug: VS Code 1.47.0 No Longer Able to Attach Node.js Debugger

Created on 11 Jul 2020  路  10Comments  路  Source: microsoft/vscode-js-debug

Describe the bug
After upgrading to VS Code 1.47.0, I am no longer able to attach my Node.js debugger in VS Code. The following error is displayed:

Error processing attach: Error: Could not connect to debug target at http://[Redacted]:5859: Could not find any debuggable target\n\tat e (c:\\Users\\[Redacted]\\.vscode\\extensions\\ms-vscode.js-debug-nightly-2020.7.1017\\src\\extension.js:15:2438843)\n\tat processTicksAndRejections (internal/process/task_queues.js:85:5)

I also tried the ms-vscode-js-debug nightly build but the error occurred for both.

To Reproduce
Steps to reproduce the behavior:

  1. Windows 10
  2. Upgrade VS Code to 1.47.0
  3. Press F5 in VS Code
  4. See error

Log File

{"tag":"runtime.launch","timestamp":1594449604718,"message":"Launch returned error","metadata":{"error":{"message":"Could not connect to debug target at http://[Redacted]:5859: Could not find any debuggable target","stack":"Error: Could not connect to debug target at http://[Redacted]:5859: Could not find any debuggable target\n\tat e (c:\\Users\\[Redacted]\\.vscode\\extensions\\ms-vscode.js-debug-nightly-2020.7.1017\\src\\extension.js:15:2438843)\n\tat processTicksAndRejections (internal/process/task_queues.js:85:5)"},"wasCancelled":true,"name":"y"},"level":2}
{"tag":"dap.send","timestamp":1594449604718,"metadata":{"connectionId":1,"message":{"seq":30,"type":"response","request_seq":2,"command":"attach","success":false,"body":{"error":{"id":9221,"format":"Error processing attach: Error: Could not connect to debug target at http://[Redacted]:5859: Could not find any debuggable target\n\tat e (c:\\Users\\[Redacted]\\.vscode\\extensions\\ms-vscode.js-debug-nightly-2020.7.1017\\src\\extension.js:15:2438843)\n\tat processTicksAndRejections (internal/process/task_queues.js:85:5)","showUser":false,"sendTelemetry":false}}}},"level":0}
{"tag":"dap.receive","timestamp":1594449604723,"metadata":{"connectionId":1,"message":{"command":"disconnect","arguments":{"restart":false},"type":"request","seq":26}},"level":0}
{"tag":"dap.send","timestamp":1594449604724,"metadata":{"connectionId":1,"message":{"seq":31,"type":"response","request_seq":26,"command":"disconnect","success":true,"body":{}}},"level":0}
{"tag":"dap.send","timestamp":1594449609724,"metadata":{"connectionId":1,"message":{"seq":32,"type":"event","event":"output","body":{"category":"telemetry","output":"js-debug/dap/operation","data":{"errors":[],"disconnect":{"operation":"disconnect","totalTime":0.8,"max":0.8,"avg":0.8,"stddev":null,"count":1,"failed":0},"!disconnect.errors":[]}}}},"level":0}

VS Code Version: 1.47.0

Additional context

Here is the launch.json configuration that is used:

{
            "type": "node",
            "request": "attach",
            "name": "Worker",
            "address": "[Redacted]",
            "port": 5859,
            "restart": true,
            "localRoot": "${workspaceRoot}",
            "remoteRoot": "[Redacted]",
            "protocol": "inspector",
            "skipFiles": [
                "<node_internals>/**/*.js"
            ]
}

I am able to attach the debugger after setting debug.javascript.usePreview to false in settings.json.

bug verified

Most helpful comment

This should be fixed in the new nightly release which I've manually triggered.

I can confirm that the nightly extension fixes the issue. Thank you for the quick fix!

All 10 comments

I've the same issue on Linux using Remote Container extension.

Ubuntu 20.04
VS Code 1.47.0
Error:

Error processing attach: Error: Could not connect to debug target at http://[Redacted]:9229: Could not find any debuggable target\n\tat e (/home/[Redacted]/.vscode-server/bin/[Redacted]/extensions\ms-vscode.js-debug/src/extension.js:15:2438843)\n\tat processTicksAndRejections (internal/process/task_queues.js:89:5)

--

I am able to attach the debugger after setting debug.javascript.usePreview to false in settings.json.

How are you launching the program you're trying to attach to?

How are you launching the program you're trying to attach to?

I'm using the following command to lunch the program:

node_modules/.bin/nest start --debug 0.0.0.0:9229 --watch

Okay, thanks for the info. That means we failed to look up the list of targets on the process, for some reason.

What happens if you run curl http://[Redacted]:9229/json/list on the machine from which you're trying to connect?

Nevermind, I found the issue. Updating shortly.

This should be fixed in the new nightly release which I've manually triggered.

This should be fixed in the new nightly release which I've manually triggered.

I can confirm that the nightly extension fixes the issue. Thank you for the quick fix!

Excellent, thanks for the confirmation!

The debugger now attaches for me when using the nightly build and setting debug.javascript.usePreview to true in settings.json. Thanks for fixing this!

Please open a new issue using the issue template.

Was this page helpful?
0 / 5 - 0 ratings