Closed patowen closed 10 months ago
Hi! Thanks for your useful report. Unfortunately tools/build-web
was not checked by the CI, so I missed it was broken. I need the web_sys_unstable_apis
flag to be enabled, even in Linux.
It used to work with Firefox, but I guess bevy has changed the backend from WebGL2 to WebGPU.
Fixed by 77b412c.
Thanks @patowen
Thanks for the fix!
Yeah, it seems like Bevy switched. It still uses WebGL2 as a default, but the only reason it's a default is because webgl2
is a default feature, but default features aren't used in this repo.
Describe the bug When building Lavagna on Windows with the
build-web
script, the resulting site works on Chrome but not Firefox.When loading on Firefox, the following errors appear in the console:
See "Additional context" for what I believe to be the root cause and fix (which worked on my computer).
To Reproduce Steps to reproduce the behavior:
tools/build-web
(On my computer, it needed to be modified withexport rustflags="--cfg=web_sys_unstable_apis"
to be able to build)python -m http.server
in thewww
directory (defaults to port 8000)Expected behavior I expect Lavagna to open on Firefox it does on Chrome.
Desktop
Additional context My wasm-bindgen version is 0.2.89.
I believe the root cause is that the web build is defaulting to WebGPU and not WebGL2. I was able to fix this by adding the
webgl2
feature tobevy
. Due to my unfamiliarity with Bevy, this fix was not easy to find, as the console did not mention WebGPU, and there were no mentions of WebGPU or WebGL2 in the codebase, making me originally doubt that this was the root case.Adding the
webgl2
feature had the added benefit of removing the requirement to addexport rustflags="--cfg=web_sys_unstable_apis"
to the build script.