denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.51k stars 5.19k forks source link

Bug: Panic with `size-limit` package #24416

Open marvinhagemeister opened 3 weeks ago

marvinhagemeister commented 3 weeks ago
============================================================
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: macos aarch64
Version: 1.44.4
Args: ["/Users/marvinh/dev/denoland/deno/target/debug/deno", "run", "-A", "npm:size-limit"]

thread 'main' panicked at /Users/marvinh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_v8-0.201.0/de.rs:268:61:
called `Result::unwrap()` on an `Err` value: BadType { actual: "v8::data::Value", expected: "v8::data::Object" }
stack backtrace:
   0: rust_begin_unwind
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:652:5
   1: core::panicking::panic_fmt
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:72:14
   2: core::result::unwrap_failed
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/result.rs:1654:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/result.rs:1077:23
   4: <&mut serde_v8::de::Deserializer as serde::de::Deserializer>::deserialize_tuple
             at /Users/marvinh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_v8-0.201.0/de.rs:268:15
   5: serde::de::impls::<impl serde::de::Deserialize for (T0,T1)>::deserialize
             at /Users/marvinh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.200/src/de/impls.rs:1430:21
   6: <core::marker::PhantomData<T> as serde::de::DeserializeSeed>::deserialize
             at /Users/marvinh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.200/src/de/mod.rs:794:9
   7: <serde_v8::de::SeqAccess as serde::de::SeqAccess>::next_element_seed
             at /Users/marvinh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_v8-0.201.0/de.rs:634:7
   8: serde::de::SeqAccess::next_element
             at /Users/marvinh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.200/src/de/mod.rs:1728:9
   9: <serde::de::impls::<impl serde::de::Deserialize for alloc::vec::Vec<T>>::deserialize::VecVisitor<T> as serde::de::Visitor>::visit_seq
             at /Users/marvinh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.200/src/de/impls.rs:1175:46
  10: <&mut serde_v8::de::Deserializer as serde::de::Deserializer>::deserialize_seq
             at /Users/marvinh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_v8-0.201.0/de.rs:260:5
  11: serde::de::impls::<impl serde::de::Deserialize for alloc::vec::Vec<T>>::deserialize
             at /Users/marvinh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde-1.0.200/src/de/impls.rs:1186:9
  12: serde_v8::de::from_v8
             at /Users/marvinh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/serde_v8-0.201.0/de.rs:53:11
  13: deno_core::runtime::ops::serde_v8_to_rust
             at /Users/marvinh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_core-0.292.0/runtime/ops.rs:347:3
  14: deno_node::ops::zlib::brotli::op_create_brotli_compress::op_create_brotli_compress::slow_function_impl
             at /Users/marvinh/dev/denoland/deno/ext/node/ops/zlib/brotli.rs:125:1
  15: deno_node::ops::zlib::brotli::op_create_brotli_compress::op_create_brotli_compress::v8_fn_ptr
             at /Users/marvinh/dev/denoland/deno/ext/node/ops/zlib/brotli.rs:125:1
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Steps to reproduce

  1. Clone https://github.com/postcss/postcss
  2. Run pnpm i
  3. Run DENO_FUTURE=1 deno task test:size

Version: Deno 1.44.4

yazan-abdalrahman commented 3 weeks ago

@marvinhagemeister,

Hello, what is expected? Return an error instead of panic or resolve the issue to make the task work.

marvinhagemeister commented 3 weeks ago

Deno should never panic and the task should print the expected output like it does under node.