Closed TechStudent10 closed 1 year ago
There is no need to be online to use wasmoon. You can use the local copy of the wasm file if you want. Example of this using webpack: https://github.com/Drumsin/aoe4-generated-map-debugger/pull/6
There is no need to be online to use wasmoon. You can use the local copy of the wasm file if you want. Example of this using webpack: Drumsin/aoe4-generated-map-debugger#6
Thank you!
Apparently you cannot use this import statement in TypeScript...
@ceifa should note that I'm not using webpack, but rather Vite.
@ceifa please get back to me. Once again, I'm using Vite (TypeScript) and I've moved to Tauri. When building it, the app fails to fetch because glue.wasm
is being served over http
. I can't build my application without removing wasmoon
.
This will be fixed on the next release, for now you can just pass the url as parameter to the factory:
new LuaFactory("https://unpkg.com/wasmoon/dist/glue.wasm")
This will be fixed on the next release, for now you can just pass the url as parameter to the factory:
new LuaFactory("https://unpkg.com/wasmoon/dist/glue.wasm")
You misunderstood me. While this is a temporary fix, I want to be able to serve it offline.
Finally found a fix. If you are using Vite, you need to copy the glue.wasm
file from node_modules/wasmoon/dist/
to your assets/public folder. Then, you can instantiate LuaFactory
like so:
new LuaFactory("/glue.wasm")
below is working for me:
import wasmoonGlueUrl from "wasmoon/dist/glue.wasm?url"
const factory = new LuaFactory(wasmoonGlueUrl)
ref:
Hi @ceifa , I have the similar problem with Vercel, here is the error log.
RuntimeError: Aborted(Error: ENOENT: no such file or directory, open 'https:/unpkg.com/wasmoon/dist/glue.wasm'). Build with -sASSERTIONS for more info.
at C (/var/task/node_modules/.pnpm/wasmoon@1.15.0/node_modules/wasmoon/dist/index.js:1181:328)
at Fa (/var/task/node_modules/.pnpm/wasmoon@1.15.0/node_modules/wasmoon/dist/index.js:1182:635)
at /var/task/node_modules/.pnpm/wasmoon@1.15.0/node_modules/wasmoon/dist/index.js:1183:399
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
I'm building an Electron app that utilizes Wasmoon. When I went off the grid and attempt to use my app, I see that wasmoon fetches a file called
glue.wasm
. Is there anyway for me to download this file and provide it to wasmoon.Thanks.