Skip to content
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 builds fail #19

Closed
sfarmer1 opened this issue Jan 22, 2022 · 6 comments
Closed

Wasm builds fail #19

sfarmer1 opened this issue Jan 22, 2022 · 6 comments

Comments

@sfarmer1
Copy link

Thanks for making this template, but when I try to follow the steps to build for web on a fresh clone of this repo, it fails with the following output:

Finished dev [optimized + debuginfo] target(s) in 2m 01s
Running wasm-server-runner target/wasm32-unknown-unknown/debug/bevy_game.wasm
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/pixelartist/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/wasm-bindgen-cli-support-0.2.79/src/descriptor.rs:208:15

I get the same error when I try to use Github Actions to build this template from tags. It seems like an issue with the wasm-bindgen step?

However, I am able to build the standard Bevy examples to web just fine.

Is anyone else running into this issue? I'm running the latest version of Pop OS (Linux) and am able to build the template for Linux just fine, just not for web.

@NiklasEi
Copy link
Owner

This seems to be an issue with the latest version of wasm-bindgen-cli.
See rustwasm/wasm-bindgen#2776

@NiklasEi
Copy link
Owner

NiklasEi commented Jan 22, 2022

Everything works fine for me on 0.2.78
I pinned the crate to this version in the makefile for now. Please let me know if that resolves the issue for you, too.

@FreddyWordingham
Copy link
Contributor

FreddyWordingham commented Jan 30, 2022

Hey, great template, thanks very much for your hard work!

Getting the same issue as descirbed above, building on OSX 12.1:

Finished dev [optimized + debuginfo] target(s) in 2m 24s
     Running `wasm-server-runner target/wasm32-unknown-unknown/debug/bevy_game.wasm`
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', /Users/freddywordingham/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/wasm-bindgen-cli-support-0.2.79/src/descriptor.rs:208:15
stack backtrace:
 0: rust_begin_unwind
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:100:14
   2: core::panicking::panic_bounds_check
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:76:5
   3: wasm_bindgen_cli_support::descriptor::Descriptor::_decode
   4: wasm_bindgen_cli_support::descriptor::Descriptor::_decode
   5: wasm_bindgen_cli_support::descriptor::Descriptor::_decode
   6: wasm_bindgen_cli_support::descriptor::Function::decode
   7: wasm_bindgen_cli_support::descriptor::Descriptor::_decode
   8: wasm_bindgen_cli_support::descriptors::execute
   9: wasm_bindgen_cli_support::Bindgen::generate_output
  10: wasm_server_runner::wasm_bindgen::generate
  11: wasm_server_runner::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Building and running natively works no problem

@CashWasabi
Copy link

I also tested it on 0.2.79 and it works fine there, too.

NiklasEi added a commit that referenced this issue Feb 25, 2022
@NiklasEi
Copy link
Owner

Do you still get this issue using the new web setup with trunk?

@NiklasEi
Copy link
Owner

With the new setup the web workflow should have improved a lot.
I'll close this for now. If you still run into issues with the new setup, feel free to open a new issue 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants