Repository: deno
Issue: Deno panick using VS-Code to debug
Labels: bug,debugger,--watch,panic

Platform: linux x86_64
Version: 2.1.3
Args: ["/home/matthias/.deno/bin/deno", "run", "--inspect-wait", "--allow-read=input.txt", "--watch", "main.ts", "--quiz=1"]

thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.324.0/inspector.rs:381:16:
internal error: entered unreachable code
stack backtrace:
   0:     0x55da62330cca - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h304520fd6a30aa07
   1:     0x55da62361f7b - core::fmt::write::hf5713710ce10ff22
   2:     0x55da6232a4d3 - std::io::Write::write_fmt::hda708db57927dacf
   3:     0x55da623324d2 - std::panicking::default_hook::{{closure}}::he1ad87607d0c11c5
   4:     0x55da6233213e - std::panicking::default_hook::h81c8cd2e7c59ee33
   5:     0x55da6297f2b5 - deno::setup_panic_hook::{{closure}}::h349393b90919cd59
   6:     0x55da62332e02 - std::panicking::rust_panic_with_hook::had2118629c312a4a
   7:     0x55da62332a83 - std::panicking::begin_panic_handler::{{closure}}::h7fa5985d111bafa2
   8:     0x55da623311a9 - std::sys::backtrace::__rust_end_short_backtrace::h704d151dbefa09c5
   9:     0x55da62332744 - rust_begin_unwind
  10:     0x55da6235ef33 - core::panicking::panic_fmt::h3eea515d05f7a35e
  11:     0x55da6235efbc - core::panicking::panic::h102d65dbfa674afe
  12:     0x55da646acb3b - deno_core::inspector::JsRuntimeInspector::poll_sessions::hea23432d5a0acfb1
  13:     0x55da6338bd7a - deno_runtime::worker::MainWorker::wait_for_inspector_session::hf36f3251a08fc007
  14:     0x55da623cfa69 - deno_runtime::worker::MainWorker::evaluate_module::{{closure}}::h6d6d786aa86b2c32
  15:     0x55da62964a8a - deno::worker::CliMainWorker::execute_main_module::{{closure}}::h413ab1558753234b
  16:     0x55da629641dd - deno::worker::CliMainWorker::run_for_watcher::{{closure}}::h18e575000b9b1ea6
  17:     0x55da6291a57a - deno::tools::run::run_script::{{closure}}::hb4796d71edee2e40
  18:     0x55da6296aeb1 - deno::spawn_subcommand::{{closure}}::h29e4d91a11efa971
  19:     0x55da62378261 - <deno_unsync::tokio::task::MaskFutureAsSend<F> as core::future::future::Future>::poll::h526086c43a2329d0
  20:     0x55da625a9c67 - tokio::runtime::task::raw::poll::h0534bc9bd8f67ab4
  21:     0x55da62980dca - deno::main::h2cfbf468374a5d6f
  22:     0x55da6246c6aa - std::sys::backtrace::__rust_begin_short_backtrace::h8c0fe723132db713
  23:     0x55da62465181 - std::rt::lang_start::{{closure}}::h39735df29837b89e
  24:     0x55da6231ec90 - std::rt::lang_start_internal::h4d90db0530245041
  25:     0x55da62a02845 - main
  26:     0x7f0786275d90 - <unknown>
  27:     0x7f0786275e40 - __libc_start_main
  28:     0x55da60c75029 - _start
  29:                0x0 - <unknown>

`launch.json`
```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": [
    {
      "request": "launch",
      "name": "Launch Program",
      "type": "node",
      "cwd": "${workspaceFolder}",
      "env": {},
      "runtimeExecutable": "/home/matthias/.deno/bin/deno",
      "runtimeArgs": ["run", "debug"],
      "attachSimplePort": 9229
    }
  ]
}
```

`deno.json`
```json
{
  "tasks": {
    "dev": "deno run --allow-read=input.txt --watch main.ts",
    "debug": "deno run --inspect-wait --allow-read=input.txt --watch main.ts --quiz=1"
  },
  "imports": {
    "@std/assert": "jsr:@std/assert@1"
  }
}
```