Next.js Discord

Discord Forum

WASM GB Emulator crashing in prd deploy on vercel

Unanswered
Oriental posted this in #help-forum
Open in Discord
OrientalOP
I'm working on a webassembly based gameboy emulator here:
https://github.com/TiKevin83/gambatte-core/tree/wasm
I have the production build deploying here:
https://gambatte-core.vercel.app/

The t3boy folder deploys to Vercel for cloud savestate functionality. Locally it is all working fine, but the Prd deploy has non-deterministic crashes like the image unless I include a manaul sleep hack before trying to interact with the emscripten code. I would love to include it as a dynamic es6 module and do the build in esm mode, but I want to use Typescript in the project and including it that way instead of with next Script made build fail with hundreds of Typescript errors, and I can't find a reliable way to hook into onRuntimeInitialized in the non-es6 mode. Will the typescript errors go away trying to use the next/dynamic import?

1 Reply

Sun bear