Hello !
CLI or linter version
bevy 0.1.0-dev (4dd0654)
[Optional] Relevant system information
rustc 1.96.0-nightly (03749d625 2026-03-14)
- Linux
What you did
I had a package with both:
- a normal binary target
- a library target with
crate-type = [\"cdylib\", \"rlib\"]
The JS-facing #[wasm_bindgen] exports were only defined in the library target, while the wasm main() in the binary target was basically empty.
Then I ran:
bevy build -p game_client web
What went wrong
I expected either:
- this layout to be supported, or
- a clear error saying that
bevy build web only supports JS-facing wasm exports from binary targets
Instead, the CLI built both wasm artifacts, but always ran wasm-bindgen on <bin>.wasm.
That ended up failing with this pretty opaque error:
error: failed to find intrinsics to enable `clone_ref` function
What made this confusing is that manually running wasm-bindgen on the generated lib*.wasm worked fine.
Additional information
This seems related to #230 because that issue already notes that the current web bundling logic is binary-oriented
Thanks !
Hello !
CLI or linter version
bevy 0.1.0-dev(4dd0654)[Optional] Relevant system information
rustc 1.96.0-nightly (03749d625 2026-03-14)What you did
I had a package with both:
crate-type = [\"cdylib\", \"rlib\"]The JS-facing
#[wasm_bindgen]exports were only defined in the library target, while the wasmmain()in the binary target was basically empty.Then I ran:
What went wrong
I expected either:
bevy build webonly supports JS-facing wasm exports from binary targetsInstead, the CLI built both wasm artifacts, but always ran
wasm-bindgenon<bin>.wasm.That ended up failing with this pretty opaque error:
What made this confusing is that manually running
wasm-bindgenon the generatedlib*.wasmworked fine.Additional information
This seems related to #230 because that issue already notes that the current web bundling logic is binary-oriented
Thanks !