Replies: 1 comment
-
add to vite.config.ts |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to use WASM in a web worker using wasm-pack in a Vue application.
I have installed 'vite-plugin-wasm'
I am loading wasm in two files main.ts and echoWorker.ts
It works in dev mode, but when I run 'npm run build-only' I get error
'''
error during build:
[vite:worker] Could not load /home/svvs/vue_wasm_template/pkg/wasm_bg.wasm (imported by pkg/wasm.js): "ESM integration proposal for Wasm" is not supported currently. Use vite-plugin-wasm or other community plugins to handle this. Alternatively, you can use
.wasm?init
or.wasm?url
. See https://vite.dev/guide/features.html#webassembly for more details.file: /home/svvs/vue_wasm_template/src/echoWorker.ts?worker
at Object.load (file:///home/svvs/vue_wasm_template/node_modules/vite/dist/node/chunks/dep-0AosnpPU.js:46241:13)
at Object.handler (file:///home/svvs/vue_wasm_template/node_modules/vite/dist/node/chunks/dep-0AosnpPU.js:51092:15)
at file:///home/svvs/vue_wasm_template/node_modules/rollup/dist/es/shared/node-entry.js:20874:40
at async PluginDriver.hookFirstAndGetPlugin (file:///home/svvs/vue_wasm_template/node_modules/rollup/dist/es/shared/node-entry.js:20774:28)
at async file:///home/svvs/vue_wasm_template/node_modules/rollup/dist/es/shared/node-entry.js:19894:33
at async Queue.work (file:///home/svvs/vue_wasm_template/node_modules/rollup/dist/es/shared/node-entry.js:20984:32)
'''
https://github.com/greenpdx/vue_wasm_template
Also It work in Chromium but but firefox in real time but when I have a break point then run it works. I think the "import * as wasm ...." in echoWorker.ts is creating a race condition in firefox
Beta Was this translation helpful? Give feedback.
All reactions