-
Notifications
You must be signed in to change notification settings - Fork 9
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
TSX files not loading in WASM #6
Comments
For anyone who encounters this, the workaround I used was to embed the tilesets in the tilemaps in Tiled. There are two ways to do this:
This embeds the tileset info into the TMX file rather than just referencing a TSX file that contains the same info. The actual tile images are still separate regardless. But it just means Bevy doesn't need to load the TSX file separately, which is where the issue occurs. It's related to the fact that the Tiled hook for fetching the TSX file is sync while the Bevy way to fetch asset data is async. So it needs to call an async method from a sync method, and currently it does this by using |
Here is the issue in rs-tiled for async loading, which when closed should make closing this issue trivial: mapeditor/rs-tiled#304 |
Hi, I believe I am having the same problem. When I used this plugin, and attempt to serve my project with Trunk the wasm seems to fail and I get:
After searching around I found your (@stevepryde) post here and that you managed to get it working on your project dizzy-ducks, and successfully exported a working wasm build to itchio. But when I cloned the dizzy ducks repo and tried to serve it locally using Trunk, I get the same issue:
Did you have the same issue, or is it a problem with my local dev environment? If so, how did you get a web build working for itchio/how did you test your web build locally? Thank you in advance, and thank you for everything you have posted so far! |
So turns the ZSTD dependency of rs-tiled, even though it was supposed to be compiled without that feature? It might be a bug with WASM bindgen or something. As a quick fix I just forked rs-tiled, removed the ZSTD dependency, then forked bevy-ecs-tiled and had it depend on that modified rs-tiled repo. |
The current approach for loading TSX files relies on
futures_lite
which doesn't work in WASM builds.We need a new approach for loading these assets in WASM
The text was updated successfully, but these errors were encountered: