LinkError thrown in browser when trying to use web browser bevy game #4888
-
For some reason, I can't use bevy to make web browser games without running into this issue. This very minimal example will reproduce it. I get "LinkError" messages thrown in the browser's console, and a white screen, and my game doesn't get run. The error that gets thrown in the browser is (although in the past, when I had this same kind of issue, I would get other similar LinkError messages):
I should expect to get a message like "panic: foobar", but I don't. The command I'm running is: Here's all the files for reproducing this: .cargo/config.toml:
Cargo.toml:
examples/game/main.rs: use bug::run;
fn main() {
run();
} src/lib.rs: use bevy::prelude::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn run() {
#[cfg(target_arch = "wasm32")]
console_error_panic_hook::set_once();
App::new()
.add_startup_system(||{panic!("foobar");})
.run();
} Is anyone else running to the same issue with this example? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
What version of I have seen similar errors when there is a version mismatch between the wasm-bindgen version and the one used in wasm-server-runner. |
Beta Was this translation helpful? Give feedback.
What version of
wasm-bindgen
do you have in your project (cargo tree --invert wasm-bindgen --target wasm32-unknown-unknown --depth 0
, should be0.2.80
)? What version ofwasm-server-runner
do you have (cargo install --list | grep wasm-server-runner
, should be >0.2.3
I think)?I have seen similar errors when there is a version mismatch between the wasm-bindgen version and the one used in wasm-server-runner.
Perhaps
cargo install wasm-server-runner
fixes the issue.