Description
Exporting the Hello World project to Web with debug mode causes the game to crash on start-up with the following error on Firefox:
wasm validation error: at offset 838450: too many locals
And with the following on Brave browser:
WebAssembly.instantiate(): Compiling function #2262:"gdnative_sys::GodotApi::from_raw::h2b788ea99960..." failed: local count too large @+838449
Presumably, this happens due to library size. .wasm
file size is 280 kB on release, 21.8 MB on debug. For reference, godot.side.wasm
is 19.2 MB in 3.5.1 and 14.8 MB in my custom build.
Using the master
version of this repository (commit 91e1b77) with Godot 3.x
branch (commit 9b0f0a713695fe074afe75ed968aafb046efefe8).
I discovered this bug while trying to compile and run GDNative with threads on web. But the issue remains even if you compile the Hello world project as explained in the book. Original discussion took place in "GDNative Threads on Web" thread on Discord server.
Somewhat related: #305