New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 error fetching bindings_wasm_bg.wasm when running rollup on the browser #14609
Comments
Update about this, I notice that when I run |
I'm experiencing the same issue. Here's a minimal reproduction repo: https://github.com/curran/rollup-v4-browser-vite-demo In that repo:
This leads me to believe it is an issue isolated to the dev server setup. Also, I was encountering a related issue around MIME types for the WASM asset, which I solved here curran/rollup-v4-browser-vite-demo#2 , but I'm not sure if this is a symptom of the underlying problem which is that Vite does not serve the file in dev at all, so of course the MIME type will be incorredt. Here's a StackOverflow post about the same/similar error https://stackoverflow.com/questions/77276441/vite-react-wasm-errors-when-running-rollup-browser-side I'm currently trying to figure out what to do for migrating to v4 to support the browser build of Rollup in a Vite-based app. Sharing my research so far here. I reviewed the migration guide https://rollupjs.org/migration/ but nothing is mentioned there about WASM for the browser build. I also see that in https://github.com/rollup/rollup/blob/master/CHANGELOG.md#general-changes There is this hint:
I'm currently trying to decipher rollup/rollup#5073 to find out if there's anything we can do outside of Vite itself to make it work. To summarize the issue, I see two possibilities:
Looking forward to solving this issue! Any clues would be greatly appreciated. |
That's how rollup bundles in the browser, using WASM: https://github.com/rollup/rollup/blob/master/browser/package.json#L23 To get it to run, add "@rollup/browser" to See: https://stackblitz.com/edit/github-hqaxdk?file=vite.config.ts |
Amazing! Thank you so much! That works for me. I've included the fix here https://github.com/curran/rollup-v4-browser-vite-demo/blob/main |
Duplicate of #8427 |
Describe the bug
Hi everyone, not sure if this is the correct place to post this, I already posted on Stack Overflow without luck.
I'm trying to use the package @rollup/browser on my project to generate a dynamic bundle as described here
I know it might sound as if this is not a vite issue, however when running the code I get the following errors:
My first question is, what exactly is the
http://localhost:5175/node_modules/.vite/deps/bindings_wasm_bg.wasm
file? Do I need to add a specific plugin for this file to exist?Then there are other problems with the MIME type, which I think I already have a workaround for, and the last error in the screenshot I think it's probably related to the missing file.
Any suggestions about this?
Reproduction
https://github.com/eltaiguer/vite-rollup
Steps to reproduce
Run:
yarn install
yarn dev
Open the console and Click on the "run" button
System Info
Used Package Manager
yarn
Logs
Validations
The text was updated successfully, but these errors were encountered: