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 2.1.0 panics on Linux, after saving a file when running with --watch #26970

Closed
argshook opened this issue Nov 21, 2024 · 2 comments · Fixed by #26972
Closed

Deno 2.1.0 panics on Linux, after saving a file when running with --watch #26970

argshook opened this issue Nov 21, 2024 · 2 comments · Fixed by #26972
Labels
--watch related to the watch feature of the CLI bug Something isn't working correctly

Comments

@argshook
Copy link

👋🏻 updated to deno 2.1.0 today. I'm working on a fresh project and with 2.1.0 saving files is now making deno to panic.

originally installed deno with curl -fsSL https://deno.land/install.sh | sh.
upgraded to 2.1.0 with deno upgrade

$ deno --version
deno 2.1.0 (stable, release, x86_64-unknown-linux-gnu)
v8 13.0.245.12-rusty
typescript 5.6.2

$ uname -a
Linux my-hostname 6.11.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 08 Nov 2024 17:57:56 +0000 x86_64 GNU/Linux

Repro

  1. create new fresh project: deno run -A -r https://fresh.deno.dev.
  2. open any file that is within --watch (like islands/Counter.tsx)
  3. hit save in editor.
  4. observe deno panic

Below is the output of RUST_BACKTRACE=full deno task start:

============================================================
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.0
Args: ["/home/user/.deno/bin/deno", "run", "-A", "--watch=static/,routes/", "dev.ts"]

thread 'main' panicked at cli/util/file_watcher.rs:189:64:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
   0:     0x5d95c0b4acca - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h304520fd6a30aa07
   1:     0x5d95c0b7bf7b - core::fmt::write::hf5713710ce10ff22
   2:     0x5d95c0b444d3 - std::io::Write::write_fmt::hda708db57927dacf
   3:     0x5d95c0b4c4d2 - std::panicking::default_hook::{{closure}}::he1ad87607d0c11c5
   4:     0x5d95c0b4c13e - std::panicking::default_hook::h81c8cd2e7c59ee33
   5:     0x5d95c1196468 - deno::setup_panic_hook::{{closure}}::h6b16ad28b68f869c
   6:     0x5d95c0b4ce02 - std::panicking::rust_panic_with_hook::had2118629c312a4a
   7:     0x5d95c0b4cab7 - std::panicking::begin_panic_handler::{{closure}}::h7fa5985d111bafa2
   8:     0x5d95c0b4b1a9 - std::sys::backtrace::__rust_end_short_backtrace::h704d151dbefa09c5
   9:     0x5d95c0b4c744 - rust_begin_unwind
  10:     0x5d95c0b78f33 - core::panicking::panic_fmt::h3eea515d05f7a35e
  11:     0x5d95c0b79127 - core::panicking::panic_bounds_check::hab02a8df06d3a143
  12:     0x5d95c0e495a7 - <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index::h89ec363596bcb4e1
  13:     0x5d95c1165b0b - deno::util::file_watcher::WatcherCommunicator::show_path_changed::h803bce6e75209163
  14:     0x5d95c1133797 - deno::tools::run::run_script::{{closure}}::hd8ceaed09991b352
  15:     0x5d95c119108b - deno::spawn_subcommand::{{closure}}::hdc7951bcc91e0c50
  16:     0x5d95c0b8f7de - <deno_unsync::tokio::task::MaskFutureAsSend<F> as core::future::future::Future>::poll::h51a76d7904c4e5b8
  17:     0x5d95c0de4914 - tokio::runtime::task::raw::poll::hee3b652d7b82c112
  18:     0x5d95c1197f3f - deno::main::h7b7bf2b36ec39222
  19:     0x5d95c0c821c1 - std::sys::backtrace::__rust_begin_short_backtrace::hc3b3f90331ffc550
  20:     0x5d95c0c7ceee - std::rt::lang_start::{{closure}}::h034aed1b20f3897e
  21:     0x5d95c0b38c90 - std::rt::lang_start_internal::h4d90db0530245041
  22:     0x5d95c1219595 - main
  23:     0x7a534ccdee08 - <unknown>
  24:     0x7a534ccdeecc - __libc_start_main
  25:     0x5d95bf48f029 - _start
  26:                0x0 - <unknown>
@bartlomieju bartlomieju added bug Something isn't working correctly --watch related to the watch feature of the CLI labels Nov 21, 2024
@yjavaherian
Copy link

same here in windows

@dsherret
Copy link
Member

@yjavaherian run deno upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
--watch related to the watch feature of the CLI bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants