Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno panicks upon a JavaScript exception after remote VS Code debugger disconnects. #28343

Open
serid opened this issue Feb 28, 2025 · 0 comments
Labels
debugger Chrome DevTools inspector/debugger integration

Comments

@serid
Copy link

serid commented Feb 28, 2025

Version: Deno 2.1.4

Hi I encountered a crash in Deno when using a VS Code debugger. I could not reproduce it with Chrome DevTools remote debugger, it probably disconnects differently.

Steps to reproduce

Create a text file main.js with the following line:

throw "stuff"

Start a Deno debugging process with command:
RUST_BACKTRACE=1 deno run --inspect-wait main.js

Open VS Code and create a VS Code launch configuration file .vscode/launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach",
            "port": 9229,
            "request": "attach",
            "type": "node"
        }
    ]
}

Open main.js in VS Code, set a breakpoint on first and only line (F9). Start debugging (F5).
At this point VS Code will connect to Deno for debugging, break on a breakpoint and work as intended.
Disconnect VS Code debugger (Shift+F5), allowing Deno execution to continue and evaluate throw "stuff".
Deno should panic. Here is full output from Deno in CLI.

Debugger listening on ws://127.0.0.1:9229/ws/090ead0b-891d-4c6c-bf33-f03144eaa005
Visit chrome://inspect to connect to the debugger.
Deno is waiting for debugger to connect.
Debugger session started.
Debugger session ended

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: linux x86_64
Version: 2.1.4
Args: ["deno", "run", "--inspect-wait", "main.js"]

thread 'main' panicked at /build/deno-2.1.4-vendor.tar.gz/deno_core/inspector.rs:258:54:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic
   3: core::option::unwrap_failed
   4: deno_core::runtime::jsruntime::JsRuntimeState::with_inspector
   5: deno_core::ops_builtin_v8::op_dispatch_exception::op_dispatch_exception::v8_fn_ptr
   6: <unknown>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
@marvinhagemeister marvinhagemeister added the debugger Chrome DevTools inspector/debugger integration label Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger Chrome DevTools inspector/debugger integration
Projects
None yet
Development

No branches or pull requests

2 participants