-
-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
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.
const luaWasmFile = path.resolve('public/lib/glue.wasm');
const factory = new LuaFactory(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
*/
import luaWasmFile from 'wasmoon/dist/glue.wasm';
const factory = new LuaFactory(luaWasmFile);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels