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
{{ message }}
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
Vite bundler not work with wasm-bindgen-rayon. It fails to build.
transforming (337) node_modules/@petamoriken/float16/src/_util/spec.mjsUnexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:
(vite:worker-import-meta-url) transform "/home/foobar/wgpu-layers/demo/src/OffscreenTileLayer.js"
error during build:
Error: Unexpected early exit. This happens when Promises returned by plugins cannot resolve. Unfinished hook action(s) on exit:
(vite:worker-import-meta-url) transform "/home/foobar/wgpu-layers/demo/src/OffscreenTileLayer.js"
at EventEmitter.handleEmptyEventLoop (file:///home/foobar/wgpu-layers/demo/node_modules/rollup/dist/es/shared/rollup.js:24061:20)
at Object.onceWrapper (node:events:627:28)
at EventEmitter.emit (node:events:525:35)
at process.<anonymous> (file:///home/foobar/wgpu-layers/demo/node_modules/rollup/dist/es/shared/rollup.js:24055:55)
at process.emit (node:events:513:28)
Probably it's a bug in vite, but I try to find a workaround for it. The problem seems to be the workerHelper.js
It seems to be that vite don't like the recursive bundling part.
My workaround for now is the following:
const worker = new Worker(location.pathname);
This works pretty well. And should work for all environments instead of inlining worker code in the main bundle. This use case should not work anymore with this approach.
The text was updated successfully, but these errors were encountered:
Vite uses esbuild, right? If so, unfortunately that's a long-standing feature request on which I commented at some time but obviously couldn't affect its implementation progress otherwise. evanw/esbuild#312, progress here evanw/esbuild#2508
Vite bundler not work with wasm-bindgen-rayon. It fails to build.
Probably it's a bug in vite, but I try to find a workaround for it. The problem seems to be the workerHelper.js
wasm-bindgen-rayon/src/workerHelpers.js
Lines 99 to 101 in c3a12c4
It seems to be that vite don't like the recursive bundling part.
My workaround for now is the following:
This works pretty well. And should work for all environments instead of inlining worker code in the main bundle. This use case should not work anymore with this approach.
The text was updated successfully, but these errors were encountered: