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

bevy_webgl2 dependency will not build #13

Open
Geordi7 opened this issue Oct 26, 2021 · 4 comments
Open

bevy_webgl2 dependency will not build #13

Geordi7 opened this issue Oct 26, 2021 · 4 comments

Comments

@Geordi7
Copy link

Geordi7 commented Oct 26, 2021

I did a fresh clone and cargo make and it gets stuck on this error:

   Compiling bevy_webgl2 v0.5.0
error[E0432]: unresolved import `winit::platform::web`
  --> /Users/geordi/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_webgl2-0.5.2/src/renderer/webgl2_render_resource_context.rs:88:30
   |
88 |         use winit::platform::web::WindowExtWebSys;
   |                              ^^^ could not find `web` in `platform`

error[E0599]: no method named `canvas` found for reference `&winit::window::Window` in the current scope
  --> /Users/geordi/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_webgl2-0.5.2/src/renderer/webgl2_render_resource_context.rs:98:14
   |
98 |             .canvas()
   |              ^^^^^^ method not found in `&winit::window::Window`

error: aborting due to 2 previous errors

I thought the issue might be in bevy_webgl2, but I cloned it and switched to the v0.5 branch and cargo make succeeds.

I also tried switching the dependency version to v0.5.2, it did not fix the issue.

I looked through the features flags for both projects, and I tried copying over the winit dependency specifier, it did not fix the issue.

I could not think of something else to try.

@Geordi7
Copy link
Author

Geordi7 commented Oct 26, 2021

Added note: I reproduced this error with rustc 1.56.0 on a M1 MacOS host and an i86_x86 Win10 host

@Geordi7
Copy link
Author

Geordi7 commented Oct 26, 2021

OK... I solved it... but it was awkward

First: running cargo make doesn't work, you have to run cargo make serve so that it correctly sets the feature flags. It might be nice to have a cargo make web option to just do the build and not run the server. Also cargo make should emit an explicit error to the user given that the build will definitely fail.

After figuring that out I ran into the problem in issue #12, which happens because wasm-bindgen-cli's latest version is later than the version referenced in bevy_webgl2.

I ran cargo install wasm-bindgen-cli --version 0.2.69, after which it built successfully. I got this idea because the Cargo.toml of bevy_webgl2 specifies this version of wasm-bindgen.

@Geordi7
Copy link
Author

Geordi7 commented Oct 27, 2021

Just Realized I closed this issue, but no changes were made to fix it...

Please update the readme to clearly state that cargo make doesn't work, and add a note about setting the version of wasm-bindgen-cli to match the wasm-bindgen version of bevy_webgl2.

@Geordi7 Geordi7 reopened this Oct 27, 2021
@mrk-its
Copy link
Owner

mrk-its commented Nov 8, 2021

Can you check again? It should do local installation of proper wasm-bindgen-cli version.
Dependencies are also fixed (it should not try to compilee bevy-webgl2 on non-wasm32 platforms), but I tested that only on linux machine so far.

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

No branches or pull requests

2 participants