Search code examples
visual-studio-codevisual-studio-debuggingdeno

Vscode debug error for Deno application: Could not connect to debug target at


I am following deno course on Pluralsight (Deno: Getting Started). I am on debugging module. When I try to start the debugger, I am getting this error message on vscode:

Error processing launch: Error: Could not connect to debug target

This is my launch settings:

{
        "name": "Launch Deno",
        "request": "launch",
        "type": "pwa-node",
        "program": "affiliate_data_server.ts",
        "cwd": "${workspaceFolder}",
        "runtimeExecutable": "deno",
        "runtimeArgs": [
            "run",
            "--inspect",
            "--allow-all"
        ],
        "attachSimplePort": 8888
    },

Debug console gives only this output:

C:\Users\kara\.deno\bin\deno.exe run --inspect --allow-all affiliate_data_server.ts

Sometimes, when I click to cancel, application still listens on the port, so i have to kill the process manually.

When i try this config instead;

{
        "name": "Node Deno",
        "type": "node",
        "request": "launch",
        "cwd": "${workspaceFolder}",
        "runtimeExecutable": "deno",
        "runtimeArgs": ["run", "--inspect", "-A", "affiliate_data_server.ts"],
        "port": 9229
    },

It starts the server but breakpoints are not working.

What would be the solution?


Solution

  • I have solved the issue by downgrading the Deno to version 1.6.1 with

    deno upgrade --version 1.6.1
    

    Source: Github