Issues with launching debug
See original GitHub issue@kitsonk Certainly; no problem.
It is still not working for me. I am still experiencing the same result as in my previous comment: https://github.com/denoland/vscode_deno/issues/12#issuecomment-737553932
Here is some additional information:
When I have no .vscode/launch.json
config and simply press F5 (run the debugger), I am presented with a list of choices. I choose the one named “Deno: Run”. After waiting several seconds, I receive this error dialog:
If I then create a custom launch config file, I can get further in the debug process, but only to the point described in my previous comment.
For comparison, here are multiple debug configs, commented to explain their sources:
{
"version": "0.2.0",
"configurations": [
{
"name": "Deno (from extension)", // generated by using "Add configuration... > Deno: Run"
"type": "pwa-node",
"request": "launch",
"program": "${workspaceFolder}/main.ts", // it seems "main.ts" is assumed, but the file might not exist
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": [
"run",
"--inspect=127.0.0.1:9229",
"--allow-all" // unsafe default
],
"attachSimplePort": 9229
},
{
"name": "Deno (from manual)", // from https://deno.land/manual@v1.8.3/getting_started/debugging_your_code#vscode
"type": "pwa-node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": ["run", "--inspect-brk", "-A", "${file}"], // unsafe default permissions
"attachSimplePort": 9229
},
{
"name": "Deno (custom)", // manually created
"type": "pwa-node",
"request": "launch",
"program": "${file}",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": [
"run",
"--inspect-brk"
],
"attachSimplePort": 9229
}
]
}
I ran this test again today on WSL, but haven’t tested again on macOS yet.
Here is a zip file containing the workspace folder used when I did this test before posting this comment:
Env:
$ deno --version
deno 1.8.3 (release, x86_64-unknown-linux-gnu)
v8 9.0.257.3
typescript 4.2.2
$ code --version
1.55.0
c185983a683d14c396952dd432459097bc7f757f
x64
$ code --list-extensions --show-versions | grep "deno"
denoland.vscode-deno@3.2.0
_Originally posted by @jsejcksn in https://github.com/denoland/vscode_deno/issues/12#issuecomment-813760294_
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:11 (5 by maintainers)
Top GitHub Comments
There are several different issues occurring here.
We didn’t have a very intelligent “default” debug configuration, nor did the code that created a
launch.json
work correctly in a lot of environments/situations. #513 should have fixed that.We changed the default from
--inspect-brk
to--inspect
because some people felt it better default, but then in that case, if you code doesn’t await for a request, or you don’t have a breakpoint test, it just exits. I will try to improve the documentation around debugging to make these clear.For now I am going to close this issue, and once #513 is released, if there are still issues, I would encourage people to open a new issue so it can be investigated, as this issue has several root causes going on.
I can confirm
--inspect-brk
works for me on Deno 1.11.2.My observation was that
--inspect
worked a few times then I started getting Could not connect to debug target (possibly after forcefully terminating debug session by pressing the stop button)