-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
A-WebBuilding or running Bevy apps targeting the browserBuilding or running Bevy apps targeting the browserC-BugA bug in the programA bug in the programD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Description
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 webWhat went wrong
I expected either:
- this layout to be supported, or
- a clear error saying that
bevy build webonly 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 !
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-WebBuilding or running Bevy apps targeting the browserBuilding or running Bevy apps targeting the browserC-BugA bug in the programA bug in the programD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesA "normal" level of difficulty; suitable for simple features or challenging fixesS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong