-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
WASM cannot build for wasm32-wasi #4906
Comments
Do you have bevy listed elsewhere in your However, I don't think wasm32-wasi will work right now, as our |
Audio is indeed behind a feature flag, just one that that is enabled by default: https://github.com/bevyengine/bevy/blob/main/docs/cargo_features.md. EDIT: yeah what @infmagic2047 said |
I looked at just pulling the pieces I need but wasm_bindgen is utilized throughout the code, such as: bevy/crates/bevy_app/src/schedule_runner.rs Lines 116 to 155 in f907d67
It seems the engine authors equate the wasm32 target with being run in a browser which does not fit my use case. I would like the code to stay lean and mean and not attempt to punt to javascript at all (the code in the not wasm32 branch would suffice for me). I will explore writing patches but worry it is going to be a huge undertaking. Probably less of a burden than writing my own engine, however :P |
You can't use |
The problem here goes way further than just audio, if I am not mistaken. Like @schtauffen mentioned bevy currently uses wasm-bindgen even on non graphical/audio related functionalities. So for example even if try to build just a bevy App() without any default-features or the default plugins, it will try to build with wasm-bindgen which is currently breaking on wasm32-wasi targets. |
To recap: the initial errors were user error but the ticket itself is valid and is related to the use of wasm-bindgen as mentioned by @pedronasser . I initially forked and began working towards a wasm32-wasi friendly version with 0.7 but wasn't successful. I plan to attempt again from scratch with 0.8; |
I cannot seem to remove labels, can S-User-Error be removed? @jakobhellermann |
This is also a huge issue for my work on the |
Bevy version
0.7
What you did
Cargo.toml
.cargo/config.toml
ran
cargo run --bin server --target wasm32-wasi
What went wrong
I expect bevy to compile for use inside wasm. Instead, it gives errors:
Additional information
I would not expect javascript/browser (js-sys, web-sys) interop to be required to compile to wasm.
The text was updated successfully, but these errors were encountered: