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

[Bug]: Panic occurred at runtime #2953

Closed
uncaught opened this issue Jul 18, 2024 · 3 comments · Fixed by #3121
Closed

[Bug]: Panic occurred at runtime #2953

uncaught opened this issue Jul 18, 2024 · 3 comments · Fixed by #3121
Labels
🐞 bug Something isn't working 🎯 upstream

Comments

@uncaught
Copy link

uncaught commented Jul 18, 2024

Version

System:
    OS: Linux 5.15 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish)
    CPU: (20) x64 Intel(R) Core(TM) i5-14600
    Memory: 13.77 GB / 15.62 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  npmPackages:
    @rsbuild/core: ^1.0.1-beta.3 => 1.0.1-beta.3
    @rsbuild/plugin-less: ^1.0.1-beta.3 => 1.0.1-beta.3
    @rsbuild/plugin-react: ^1.0.1-beta.3 => 1.0.1-beta.3
    @rsbuild/plugin-svgr: ^1.0.1-beta.3 => 1.0.1-beta.3

Details

I upgraded from 0.7.6 to beta.3 along with other library updates and this is the output:

client-1  | > [email protected] dev
client-1  | > rsbuild dev
client-1  |
client-1  |   Rsbuild v1.0.1-beta.3
client-1  |
client-1  |   > Local:    http://localhost:3000/
client-1  |   > Network:  http://172.21.0.2:3000/
client-1  |
client-1  | start   Compiling...
client-1  | thread 'Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
client-1  | Message:  called expect on Module(Module { span: 1..78#0, body: [Stmt(Empty(EmptyStmt { span: 78..4294967220#0 }))], shebang: None })
client-1  | Location: swc_ecma_ast-0.115.1/src/module.rs:8
client-1  |
client-1  | Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
client-1  | Run with RUST_BACKTRACE=full to include source snippets.
client-1  | <unnamed>' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.44/src/impls/core/mod.rs:266:67:
client-1  | called `Result::unwrap()` on an `Err` value: LayoutError
client-1  | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
client-1  | <empty backtrace>
client-1  | Aborted
client-1  |
client-1  | > [email protected] dev
client-1  | > rsbuild dev
client-1  |
client-1  |   Rsbuild v1.0.1-beta.3
client-1  |
client-1  |   > Local:    http://localhost:3000/
client-1  |   > Network:  http://172.21.0.2:3000/
client-1  |
client-1  | start   Compiling...
client-1  | thread '<unnamed>' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rkyv-0.7.44/src/impls/core/mod.rs:266:67:
client-1  | called `Result::unwrap()` on an `Err` value: LayoutError
client-1  | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
client-1  | Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
client-1  | Message:  called expect on Module(Module { span: 1..78#0, body: [Stmt(Empty(EmptyStmt { span: 78..4294967220#0 }))], shebang: None })
client-1  | Location: swc_ecma_ast-0.115.1/src/module.rs:8
client-1  |
client-1  | Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
client-1  | Run with RUST_BACKTRACE=full to include source snippets.
client-1  | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
client-1  | <empty backtrace>
client-1  | Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
client-1  | Message:  failed to invoke plugin: failed to invoke plugin on 'Some("/var/projects/wccb_pwa/client/src/index.tsx")'
client-1  |
client-1  | Caused by:
client-1  |     0: failed to invoke `@swc/plugin-styled-jsx` as js transform plugin at @swc/plugin-styled-jsx
client-1  |     1: failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-core for compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.
client-1  |
client-1  |                         Note that if you want to use the os features like filesystem, you need to use `wasi`. Wasm itself does not have concept of filesystem.
client-1  |     2: RuntimeError: unreachable
client-1  |            at <unnamed> (<module>[15324]:0x6a0abc)
client-1  |            at <unnamed> (<module>[15315]:0x6a0711)
client-1  |            at <unnamed> (<module>[15314]:0x6a0437)
client-1  |            at <unnamed> (<module>[15301]:0x69f7db)
client-1  |            at <unnamed> (<module>[15300]:0x69f73e)
client-1  |            at <unnamed> (<module>[15309]:0x69ff4b)
client-1  |            at <unnamed> (<module>[15520]:0x6b2bca)
client-1  |            at <unnamed> (<module>[15573]:0x6ba8b2)
client-1  |            at <unnamed> (<module>[35]:0x9179)
client-1  |            at <unnamed> (<module>[145]:0x27baa)
client-1  |            at <unnamed> (<module>[35]:0x90cc)
client-1  |            at <unnamed> (<module>[33]:0x7ecc)
client-1  |            at <unnamed> (<module>[316]:0x43d2a)
client-1  |            at <unnamed> (<module>[15700]:0x6c56f3)
client-1  | Location: swc-0.279.1/src/plugin.rs:169
client-1  |
client-1  | Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
client-1  | Run with RUST_BACKTRACE=full to include source snippets.
client-1  | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
client-1  | <empty backtrace>
client-1  | Aborted

(This runs in a docker container node:22.2.0-bookworm)

Reproduce link

https://github.com/uncaught/rsbuild-panic-1.git

Reproduce Steps

git clone https://github.com/uncaught/rsbuild-panic-1.git
cd rsbuild-panic-1
npm i
npm run dev
@uncaught uncaught added the 🐞 bug Something isn't working label Jul 18, 2024
@chenjiahan
Copy link
Member

The SWC plugin needs to be upgraded. see https://rsbuild.dev/config/tools/swc#register-swc-plugin

failed to invoke `@swc/plugin-styled-jsx` as js transform plugin at @swc/plugin-styled-jsx
failed to run Wasm plugin transform. Please ensure the version of `swc_core` used by the plugin is compatible with the host runtime. See https://swc.rs/docs/plugin/selecting-swc-core for compatibility information. If you are an author of the plugin, please update `swc_core` to the compatible version.

@uncaught
Copy link
Author

uncaught commented Jul 18, 2024

Can you please add appropriate peer dependencies to your packages, so this doesn't happen? I remember this isn't the first time. It's a poor experience if npm update never works out of the box reliably.

@chenjiahan
Copy link
Member

@swc/plugin-styled-jsx is not a peer dependency of Rsbuild, Rsbuild does not depend on this plugin. And this issue is caused by SWC, not Rspack or Rsbuild.

I totally agree that this is a critical issue, you can create an issue in the SWC repository to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🎯 upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants