Open gmelodie opened 1 year ago
While trying to run my game in the browser after compiling to wasm I'm getting the following error as well as many similar others. Basically every type of input gives me this error. I have no clue how to debug this, any help is highly appreciated :)
Uncaught RuntimeError: unreachable executed onmousemove https://not-fl3.github.io/miniquad-samples/mq_js_bundle.js:3 run_animation_loop https://not-fl3.github.io/miniquad-samples/mq_js_bundle.js:3 load https://not-fl3.github.io/miniquad-samples/mq_js_bundle.js:3 promise callback*load https://not-fl3.github.io/miniquad-samples/mq_js_bundle.js:3 <anonymous> http://localhost:4000/:26 132 [game-rust.wasm:2085279:1](http://localhost:4000/game-rust.wasm) _ZN3std9panicking20rust_panic_with_hook17hd000e9fb43b5781dE http://localhost:4000/game-rust.wasm:2085279 _ZN3std9panicking19begin_panic_handler28_$u7b$$u7b$closure$u7d$$u7d$17he16e52e9a7dddeb1E http://localhost:4000/game-rust.wasm:2082503 _ZN3std10sys_common9backtrace26__rust_end_short_backtrace17h227361e053771d9eE http://localhost:4000/game-rust.wasm:2082289 rust_begin_unwind http://localhost:4000/game-rust.wasm:2084349 _ZN4core9panicking9panic_fmt17h9d972fcdb087ce21E http://localhost:4000/game-rust.wasm:2090916 _ZN4core6result13unwrap_failed17h2b47cc7f7e98a508E http://localhost:4000/game-rust.wasm:2095306 _ZN4core4cell16RefCell$LT$T$GT$10borrow_mut17hc3cfb6feca44e3a0E http://localhost:4000/game-rust.wasm:2035120 _ZN8miniquad6native4wasm4with28_$u7b$$u7b$closure$u7d$$u7d$17hb37b3d689bae9ab2E http://localhost:4000/game-rust.wasm:1963890 _ZN3std6thread5local17LocalKey$LT$T$GT$8try_with17hdb790bc54a1bb174E http://localhost:4000/game-rust.wasm:2011375 _ZN3std6thread5local17LocalKey$LT$T$GT$4with17h97abff7380f7e532E http://localhost:4000/game-rust.wasm:2010907 _ZN8miniquad6native4wasm4with17h675120befcc563f5E http://localhost:4000/game-rust.wasm:1957625 mouse_move http://localhost:4000/game-rust.wasm:1967773 onmousemove https://not-fl3.github.io/miniquad-samples/mq_js_bundle.js:3 (Async: EventHandlerNonNull) run_animation_loop https://not-fl3.github.io/miniquad-samples/mq_js_bundle.js:3 _ZN8miniquad6native4wasm3run17he56a0f1c27d75256E http://localhost:4000/game-rust.wasm:65133 _ZN8miniquad5start17h5242f6196d8617a2E http://localhost:4000/game-rust.wasm:64848 _ZN9macroquad6Window11from_config17h22f2d05caa8a82bbE http://localhost:4000/game-rust.wasm:14813 _ZN9game_rust4main17h2e4699025f146961E http://localhost:4000/game-rust.wasm:52853 _ZN4core3ops8function6FnOnce9call_once17hef3e14e344693835E http://localhost:4000/game-rust.wasm:44383 _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17hdd84b825f88c7c88E http://localhost:4000/game-rust.wasm:25720 _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17hcdf78914e702a63dE http://localhost:4000/game-rust.wasm:71921 _ZN3std2rt19lang_start_internal17hbecc6ff7763fb2f1E http://localhost:4000/game-rust.wasm:2077287 _ZN3std2rt10lang_start17ha38194990152f58cE http://localhost:4000/game-rust.wasm:71822 main http://localhost:4000/game-rust.wasm:52985 load https://not-fl3.github.io/miniquad-samples/mq_js_bundle.js:3 (Async: promise callback) load https://not-fl3.github.io/miniquad-samples/mq_js_bundle.js:3 <anonymous>
Clone and compile code
git clone https://github.com/gmelodie/rust-game cd rust-game cargo build --target wasm32-unknown-unknown && cp target/wasm32-unknown-unknown/debug/game-rust.wasm .
At the root dir, create an index.html file with the following contents:
index.html
<html lang="en">
While trying to run my game in the browser after compiling to wasm I'm getting the following error as well as many similar others. Basically every type of input gives me this error. I have no clue how to debug this, any help is highly appreciated :)
Reproducing
Clone and compile code
At the root dir, create an
index.html
file with the following contents: