vscode_deno
vscode_deno copied to clipboard
--watch flag causes vscode debugger to crash
Run the project with --watch and --inspect-wait flags. When a file is edited, the debug sessions stops and the deno process dies.
To Reproduce
- Create a basic deno project. This will do:
Deno.serve((_request: Request) => { return new Response("Hello, world!"); });
Create launch.json with run flags:
"runtimeArgs": [ "run", "--inspect-wait", "--watch", ]
-
Run from vscode debugger, load browser to localhost:8000
-
Edit a file, save.
-
Notice that the debugger and deno have crashed.
Expected behavior
Just restart normally. It works fine if you run the same commands from the terminal (then use chrome debugger) - so obviously the vscode debugger is involved somehow.
Screenshots
Unfortunately, there is nothing useful in the runtime logs.
Versions
vscode: 1.83.1 deno 1.37.2 (release, aarch64-apple-darwin) v8 11.8.172.13 typescript 5.2.2
same here
I've found this as well.
I tried resolving it by adding "restart": true
to the launch.json config for the debugger but that still causes issues with the output reporting.
Cannot start inspector server: error creating server listener: Address already in use (os error 48).
Process exited with code 1
Adding a delay doesn't seem to help either.
I am facing the same issue on deno 1.40.4 (release, x86_64-pc-windows-msvc) | vscode_deno 3.33.3 | vscode 1.86.1
. In my Node projects the VS Code debugger works just fine with --watch
, but with Deno the debugger dies as soon as any file is changed. Are the developers aware of this issue?
I'm experiencing this too but wanted to share a temporary work-around I found
- Create a debug process that attaches to the running program. include
restart: true
-
{ "request": "attach", "type": "node", "restart": true, "port": 9229 }
-
- Launch your Deno program via commandline/task with
--watch
and--inspect-wait
flags - do the attaching (via F5 or whatever)
Also works with --unstable-hmr
This way you can get auto-reloading and break-points working together.
It's kinda annoying to have to attach the debugger separately, but you only have to do it once per start-up if you have restart: true