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
{{ message }}
Repository navigation
2D cores and CLI toolchains ship node-only glue, so romdev-core-host's browser path can't load them #7
but the published glue can't run outside Node. Every 2D libretro core and every tool linked with EM_CLI_FLAGS in scripts/_lib.sh (sdcc/sdas*/sdld, mcpp, rgbds, cc65, asar, dasm, tcc816, wla-dx, vasm) is built with -s ENVIRONMENT=node, so emcc hard-codes
and loading romdev-core-gambatte@0.12.1's gambatte_libretro.js (or romdev-toolchain-sdcc@0.2.2's sdcc.js) in a page or a module Web Worker fails on import("module") before the wasm is instantiated. Nothing in these cores or tools needs Node — they only use MEMFS — and the GPU cores (flycast, beetle-psx-hw, parallel-n64) already link with ENVIRONMENT=node,web.
Repro (Chrome, static server, files copied from romdev-core-gambatte@0.12.1/wasm/):
→ TypeError: Failed to resolve module specifier 'module'. The same page with the glue relinked with -s ENVIRONMENT=node,web,worker (same recipe, emscripten 4.0.18 image) loads fine — and the rebuilt gambatte_libretro.wasm is byte-identical to the published one; only the glue changes.
Workaround I'm using today: rewrite var ENVIRONMENT_IS_NODE=true → false in the glue after install. With that one flag flipped, gambatte + the SDCC sm83 pipeline run fine in a Web Worker (built and played GB/GBC ROMs in the browser), which suggests the right fix is just the link flag.
Proposal: link these recipes with -s ENVIRONMENT=node,web,worker. Runtime detection keeps picking node under Node, so the server is unaffected, and the .wasm output doesn't change (only the JS glue). A guard in scripts/verify-wasm.mjs could keep them from regressing at publish time. I have a PR ready for this.
Activity
deviankim commentedon Oct 29, 2026
Update: I closed #8, it had grown well past this issue. #15 is a fresh PR against current main with only this change.
Since I opened this, vasm is gone from main, so it is out of the list, and bsnes is new and gets the same flag.