Skip to content

bevy run web --unstable multi-threading panics #642

@RobertoMaurizzi

Description

@RobertoMaurizzi

CLI or linter version

bevy_cli both latest release v0.1.0-alpha.2 and built from main at 154bf17

Relevant system information

Debian testing
cargo 1.92.0-nightly (801d9b498 2025-10-04)
rustc 1.92.0-nightly (f6aa851db 2025-10-07)

default .cargo/config.toml (meaning, not there, I didn't rename the file)

What you did

  • created a new bevy_new_2d project
  • added rust-toolchain.toml to use nightly
  • added:
[package.metadata.bevy_cli.unstable]
web-multi-threading = true
  • ran bevy run web --unstable multi-threading

What went wrong

I got:

warning: unstable feature specified for `-Ctarget-feature`: `atomics`
  |
  = note: this feature is not stably supported; its behavior can change in the future

warning: `bevy_new_2d_017` (bin "bevy_new_2d_017") generated 1 warning
    Finished `web` profile [optimized + debuginfo] target(s) in 2m 16s
info: bundling JavaScript bindings...

thread 'main' panicked at /home/robm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wasm-bindgen-cli-support-0.2.104/src/interpreter/mod.rs:218:21:
wasm_bindgen::__rt::wbg_cast::breaks_if_inlined::h1bb6e5dce38e1af3: unknown instruction Block(Block { seq: Id { idx: 1 } })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: failed to run wasm-bindgen, trying to find automatic fix...
error: command `wasm-bindgen --no-typescript --out-name bevy_new_2d_017 --out-dir /home/robm/bevy_new_2d_017/target/wasm32-unknown-unknown/web --target web /home/robm/bevy_new_2d_017/target/wasm32-unknown-unknown/web/bevy_new_2d_017.wasm` exited with status code exit status: 101

Additional information

It might very well that I've missed an obvious step or there's a missing one in the documentation.
I first tried to enable multithreading on a demo application I have that would really benefit from it but still didn't try to do anything wasm multithreading specific in it.
I then tried on bevy_new_2d and it was the same (both have no wasm multithread specific crates, I think).
It might be I need to add a crate and, that missing, wasm-bindgen misbehaves?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WebBuilding or running Bevy apps targeting the browserC-BugA bug in the programS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions