Vscode-js-debug: 1.47.3 vscode debug occur "Error processing attach: Error: Could not connect to debug target at..."

Created on 5 Aug 2020  ·  10Comments  ·  Source: microsoft/vscode-js-debug

Describe the bug
I'm debugging vetur find thie error Error processing attach: Error: Could not connect to debug target at http://localhost:6005: Could not find any debuggable target

To Reproduce
Steps to reproduce the behavior:

  1. upgrade vscode to 1.47.3
  2. add vetur to workspace
  3. click debug icon,then start all(include clinet and server)
  4. start a extenstion host ,for a while then occur this error "Error processing attach: Error: Could not connect to debug target at http://localhost:6005: Could not find any debuggable target..."
    I have seen someone repeat 1.47.0 25 days ago, I also try nightly release,but the error also exist

Log File

VS Code Version: Replace me!

Additional context
Add any other context about the problem here.

needs more info

Most helpful comment

I think I might get the reason: Before I start the debugger, a .vue file and vetur project should display in the extension host.

All 10 comments

Please share your launch config or log file using the instructions in the template.

Please share your launch config or log file using the instructions in the template.

In fact, .I just debug the code that cloned from vetur,I don't modify anything.
Here is the launch.json configuration that is used:

{
      "name": "server",
      "type": "node",
      "request": "attach",
      "port": 6005,
      "sourceMaps": true,
      "outFiles": ["${workspaceFolder}/server/dist/**/*.js"],
      "protocol": "inspector",
      "restart": true,
      "smartStep": true,
      "skipFiles": ["<node_internals>/**"]
    },

Okay, that looks sane. Can you grab the log file as well?

Okay, that looks sane. Can you grab the log file as well?

Sorry, Could you please tell me where I can see the log file,Also I think you may try 1.47.3 vscode , debug vetur (the latest code) and may find the error

The comment in the template has instructions :)

If you're able to, add "trace": true to your launch.json and reproduce the issue. The location of the log file on your disk will be written to the Debug Console. Share that with us.

⚠️ This log file will not contain source code, but will contain file paths. You can drop it into https://microsoft.github.io/vscode-pwa-analyzer/index.html to see what it contains. If you'd rather not share the log publicly, you can email it to [email protected]

I'm not sure this is related vetur, since it looks like you're trying to debug a Node.js server, not Vue...

The comment in the template has instructions :)

If you're able to, add "trace": true to your launch.json and reproduce the issue. The location of the log file on your disk will be written to the Debug Console. Share that with us.
⚠️ This log file will not contain source code, but will contain file paths. You can drop it into https://microsoft.github.io/vscode-pwa-analyzer/index.html to see what it contains. If you'd rather not share the log publicly, you can email it to [email protected]

I'm not sure this is related vetur, since it looks like you're trying to debug a Node.js server, not Vue...

Okay,Thanks for tellimg me hoewto find log file,here is the log file,

{
  "tag": "runtime.launch",
  "timestamp": 1596695478963,
  "message": "Error looking up /json/version",
  "metadata": {
    "ok": false,
    "body": "connect ECONNREFUSED 127.0.0.1:6005",
    "statusCode": 503,
    "error": {
      "message": "Unexpected 503 response from http://localhost:6005/json/version",
      "stack": "Error: Unexpected 503 response from http://localhost:6005/json/version\n\tat _.fetchHttp (/Users/wy/.vscode/extensions/ms-vscode.js-debug-nightly-2020.8.517/src/extension.js:21:172206)\n\tat runMicrotasks (<anonymous>)\n\tat processTicksAndRejections (internal/process/task_queues.js:85:5)"
    }
  },
  "level": 0
}

{
  "tag": "runtime.launch",
  "timestamp": 1596695482119,
  "message": "Error looking up /json/list",
  "metadata": {
    "ok": false,
    "body": "connect ECONNREFUSED 127.0.0.1:6005",
    "statusCode": 503,
    "error": {
      "message": "Unexpected 503 response from http://localhost:6005/json/list",
      "stack": "Error: Unexpected 503 response from http://localhost:6005/json/list\n\tat _.fetchHttp (/Users/wy/.vscode/extensions/ms-vscode.js-debug-nightly-2020.8.517/src/extension.js:21:172206)\n\tat runMicrotasks (<anonymous>)\n\tat processTicksAndRejections (internal/process/task_queues.js:85:5)"
    }
  },
  "level": 0
}

{
  "tag": "runtime.launch",
  "timestamp": 1596695485419,
  "message": "Error looking up /json/version",
  "metadata": {
    "ok": false,
    "body": "connect ECONNREFUSED 127.0.0.1:6005",
    "statusCode": 503,
    "error": {
      "message": "Unexpected 503 response from http://localhost:6005/json/version",
      "stack": "Error: Unexpected 503 response from http://localhost:6005/json/version\n\tat _.fetchHttp (/Users/wuyan14/.vscode/extensions/ms-vscode.js-debug-nightly-2020.8.517/src/extension.js:21:172206)\n\tat runMicrotasks (<anonymous>)\n\tat processTicksAndRejections (internal/process/task_queues.js:85:5)"
    }
  },
  "level": 0
}

{
  "tag": "runtime.launch",
  "timestamp": 1596695485857,
  "message": "Launch returned error",
  "metadata": {
    "error": {
      "message": "Could not connect to debug target at http://localhost:6005: Promise was canceled",
      "stack": "Error: Could not connect to debug target at http://localhost:6005: Promise was canceled\n\tat e (/Users/wy/.vscode/extensions/ms-vscode.js-debug-nightly-2020.8.517/src/extension.js:1:92977)"
    },
    "wasCancelled": true,
    "name": "y"
  },
  "level": 2
}

{
  "tag": "dap.receive",
  "timestamp": 1596695475846,
  "metadata": {
    "connectionId": 14,
    "message": {
      "command": "attach",
      "arguments": {
        "name": "server",
        "trace": true,
        "type": "pwa-node",
        "request": "attach",
        "port": 6005,
        "sourceMaps": true,
        "outFiles": [
          "/Users/wy/code/vetur-master/server/dist/**/*.js"
        ],
        "protocol": "inspector",
        "restart": true,
        "smartStep": true,
        "skipFiles": [
          "<node_internals>/**"
        ],
        "cwd": "/Users/wy/code/vetur-master",
        "logFilePath": "/Users/wy/Library/Application Support/Code/logs/20200806T142649/exthost1/ms-vscode.node-debug/debugadapter-legacy.txt",
        "__debuggablePatterns": [
          "*.js",
          "*.es6",
          "*.jsx",
          "*.mjs"
        ],
        "__workspaceFolder": "/Users/wy/code/vetur-master",
        "__sessionId": "40f7e00a-b4ae-4afb-a495-fe1651e3e2be"
      },
      "type": "request",
      "seq": 2
    }
  },
  "level": 0
}

I think I might get the reason: Before I start the debugger, a .vue file and vetur project should display in the extension host.

Okay, well, the message says the reason -- we're trying to attach to the target on port 6005 and there's nothing listening on that port. From the VS Code side things seem to be working as designed; make sure that you're launching the server and launching it in debug mode on the correct port.

There doesn't appear to be anything actionable for js-debug here.

I am trying to debug vetur and encounter the same error too.Could you tell me detailedly how you solved the problem at the end? @suyanzhi

Was this page helpful?
0 / 5 - 0 ratings