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
Problem
Failed to initialize LuaFactory in Vercel with custom wasm file path.
Demo code
// This way we could load the wasm file in Vercel production environment.constluaWasmFile=path.resolve('public/lib/glue.wasm');constfactory=newLuaFactory(luaWasmFile);
Error output
failed to asynchronously prepare wasm: TypeError: WebAssembly.instantiate(): Import #0 module="env" error: module is not an object or function
Remarks
I don't know whether it is related to the file import method or not, but I have tried many ways, only the above way worked in Vercel production environment.
/** * These didn't work in Vercel production environment, luaWasmFile will be not found. * * 1. https://vercel.com/docs/functions/wasm * 2. https://github.com/Drumsin/aoe4-generated-map-debugger/pull/6/files */importluaWasmFilefrom'wasmoon/dist/glue.wasm';constfactory=newLuaFactory(luaWasmFile);
The text was updated successfully, but these errors were encountered:
I tried using a custom build wasmoon dist/index.js and glue.wasm, this error disappeared, but there was a new error when executed await factory.createEngine() - e is not a function.
I have no idea with what e is as the code was minified.
Problem
Failed to initialize LuaFactory in Vercel with custom wasm file path.
Demo code
Error output
Remarks
I don't know whether it is related to the file import method or not, but I have tried many ways, only the above way worked in Vercel production environment.
The text was updated successfully, but these errors were encountered: