denoland / vscode_deno

Visual Studio Code plugin for Deno
https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno
MIT License
1.47k stars 141 forks source link

Debugger doesn't start #476

Closed grian32 closed 3 years ago

grian32 commented 3 years ago

Describe the bug

Debugger crashes with an error(VSCode wouldn't let me copy paste so I put the screenshot below) as soon as I click the start button, my launch.json was automatically generated.

I'd gotten the debugger to start up by making some breakpoints on a couple test's code but it didn't show variables or let me step through code and for some reason it made my julia extension and the julia language server start up.

To Reproduce

  1. Make a file with this code named main.ts:
    let msg = "hello world";
    console.log(msg);
  2. Make this your launch.json:
    {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Deno: Run",
            "request": "launch",
            "type": "pwa-node",
            "program": "main.ts",
            "cwd": "${workspaceFolder}",
            "runtimeExecutable": "deno",
            "runtimeArgs": [
                "run",
                "--unstable",
                "--inspect",
                "--allow-all"
            ],
            "attachSimplePort": 9229
        }
    ]
    }
  3. Try to run debugger

Expected behavior

The debugger to start, show me variables, let me step through breakpoints, all that stuff that a debugger's meant to do.

Screenshots

image

Versions

vscode: 1.58.2 deno: 1.12.1 extension: 3.7.0

bartlomieju commented 3 years ago

I'm not sure if it will work with program argument, have you tried using example config from manual?

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Deno",
      "type": "pwa-node",
      "request": "launch",
      "cwd": "${workspaceFolder}",
      "runtimeExecutable": "deno",
      "runtimeArgs": ["run", "--inspect-brk", "-A", "${file}"],
      "attachSimplePort": 9229
    }
  ]
}
grian32 commented 3 years ago

@bartlomieju That worked, thanks a bunch, I didn't realize I needed to get the example config from the manual, since there was one automatically generated.

Perhaps could change the default launch.json to that for deno if possible?

RomanKornev commented 2 years ago

It would be nice if the autogenerated config was updated