You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a crate that works with game's save file, i parse everything in SaveFile struct that holds a few fields, one of them is forge, this struct has a method that uses a large hashmap that contains "definitions" for specific IDs that save file can have, SCHEMATICS is said hashmap:
Calling a function that uses that hashmap causes locals exceed maximum error when trying to build a wasm file.
Change this line to forge: Forge::from_gvas(gvas)?,
Run cargo build in main directory
Build editor_ui with trunk build or wasm-bindgen
Expected Behavior
Wasm generating with no errors
Actual Behavior
throws an error:
error: failed getting Wasm module for 'drg-save-editor\target\wasm32-unknown-unknown\debug\editor_ui.wasm'
Caused by:
0: failed to parse input as wasm
1: failed to parse code section
2: locals exceed maximum (at offset 1931704)
2023-05-24T16:54:38.126342Z ERROR ❌ error
error from HTML pipeline
Caused by:
0: error from asset pipeline
1: wasm-bindgen call returned a bad status
You can see how you can figure out which function it is here: bytecodealliance/wasm-tools#665. You then have to split it into multiple functions to avoid hitting that limit.
Describe the Bug
I have a crate that works with game's save file, i parse everything in
SaveFile
struct that holds a few fields, one of them isforge
, this struct has a method that uses a large hashmap that contains "definitions" for specific IDs that save file can have,SCHEMATICS
is said hashmap:Calling a function that uses that hashmap causes
locals exceed maximum
error when trying to build a wasm file.Steps to Reproduce
forge: Forge::from_gvas(gvas)?,
cargo build
in main directoryeditor_ui
withtrunk build
orwasm-bindgen
Expected Behavior
Wasm generating with no errors
Actual Behavior
throws an error:
Additional Context
More info in original issue on trunk repo
The text was updated successfully, but these errors were encountered: