WASM: IDBFS not exported to runtime under Emscripten 5.0.0 — /save mount throws ReferenceError #385
Labels
No labels
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
priority:tier4-deferred
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:procgen
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
john/McRogueFace#385
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
Loading any WASM build (playground or shipped game) throws at startup:
Root cause
Both
src/shell.htmlandsrc/shell_game.htmlmount IDBFS at/save/inModule.preRunfor persistent game data:The IDBFS implementation is linked in (
-lidbfs.jsinCMakeLists.txt), butEXPORTED_RUNTIME_METHODSonly listedccall,cwrap,FS—IDBFSwasmissing. Bare
FSworks inpreRunbecause it is exported; bareIDBFSwasnot, so it never reached the shell scope.
Older Emscripten auto-exposed
IDBFS; Emscripten 5.0.0 stopped doing so,which is why this only surfaced on a fresh rebuild — the previously-deployed
playground was built with an older SDK.
Fix
Add
IDBFSto the shared Emscripten link flags inCMakeLists.txt:Verified: the rebuilt glue JS now contains
Module["IDBFS"]=IDBFS(absentbefore), and the
/savemount no longer throws. The flag block is shared acrossall Emscripten targets, so playground and game builds are fixed.
Follow-up
The shipped
0.2.8WASM.zipgame predates this and should be rebuilt beforethe web game is relied upon (it would hit the same crash if built under
Emscripten 5.0.0).