Open AlexErrant opened 5 months ago
On a separate but related PR, I noticed that vite build
fails with the same "JavaScript heap out of memory" error when using wasm-bindgen-rayon in a separate webworker (as was mandatory in <=v1.1.3) even when using @surma/rollup-plugin-off-main-thread
. I had to move the code out of the web worker to get vite build
to work.
Hypothetically, if I wanted to use a separate web worker, would you know the solution to this? Don't waste too much time if you don't know - I really don't mind not having to spin up another worker. Just asking for the sake of completeness :)
Edit: Updating Vite to 5.1.6
(released a few weeks after this comment) or higher fixes this issue.
Updating Vite to 5.1.6+ removes the need for @surma/rollup-plugin-off-main-thread
. This PR now simply adds a test, which may be useful to guard against regressions.
Hi, thanks for a great library. This PR updates the Readme with instructions for Vite and adds Vite to the test suite.
Without
@surma/rollup-plugin-off-main-thread
, thevite build
command fails withHowever, with
@surma/rollup-plugin-off-main-thread
, the dev servernpx vite dev
causes the page to try to loadhttp://localhost:5173/pkg/snippets/wasm-bindgen-rayon-3e04391371ad0a8e/src/undefined
which obviously doesn't exist and results inFailed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.
Possibly related.Therefore, we conditionally use
@surma/rollup-plugin-off-main-thread
based on Vite's "mode".