-
Notifications
You must be signed in to change notification settings - Fork 327
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
bug: vite build
fails due to out of memory error
#6527
Comments
the cause is 0.34.0 - 23.3mb |
Thanks, duly noted. This is indeed not ideal, we should put this larger debug-symbols-included version in another package but have not yet. Meanwhile, can you let us know how much RAM you have? |
16gb. If i allow nodejs to use more memory via |
Thanks makes sense, helpful to know. I see someone was actually able to resolve such an issue on vercel sveltejs/kit#4795 wonder if you can set it in build step, but limited context so sorry if already tried |
Hi there! Just wanted to see if we had to do something here or if the setting could be applied in vercel (our preference for now). Were you able to try this? |
@ludamad is it time to reduce bb.js size? More and more people are stumbling upon this issue |
It is now done, will be in next release |
... or it was in but strangely broke things, hopefully will be able to investigate why soon |
btw, are you gonna keep It does not play well with browsers because the whole aztec.js sdk depends on BarretenbergSync and something as simple as |
@olehmisar as per our chat on discord DMs, could you confirm if increasing ram given to node in vercel fixed the build error |
@rahul-kothari no, not fixed. As per comment above it still fails to build on vercel. Looks like vercel does not allow increasing RAM. Same thing with netlify. Increasing RAM only works locally. |
Are you not able to change the build command Vercel runs? Does it not just do a yarn/npm build so you can fix like the command above that worked for svelte? |
You can try deploying this repro on vercel to see yourself https://github.com/ShieldSwap/aztec-build-out-of-memory-repro |
I didn't say it was svelte specific, I was giving an example that seemingly
resolved it. We are not committed to supporting less than 16gb of RAM at
this time so would appreciate if you could investigate more on vite side
…On Mon, Sep 30, 2024, 4:39 PM oleh ***@***.***> wrote:
@ludamad <https://github.com/ludamad>
1. I can change the build command. But vercel/netlify just ignores
NODE_OPTIONS=--max_old_space_size=16384 flag. Or vercel/netlify VPS
just does not have 16gb of memory.
2. It's not sveltekit specific, it's vite specific.
You can try deploying this repro on vercel to see yourself
https://github.com/ShieldSwap/aztec-build-out-of-memory-repro
—
Reply to this email directly, view it on GitHub
<#6527 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABIBGJF5AMUVVVP764Z6LLZZGZIFAVCNFSM6AAAAABH5KEIN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBUGEYDIMZYG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@ludamad there is nothing to investigate. Vite uses rollup under the hood. Rollup crashes during build because it tries to load bb.js into RAM. Vercel/Netlify do not allow increasing memory during build time, so if you are not committed to supporting less than 16gb of RAM, then nobody will be able to deploy to Vercel/Netlify if they are using vite. It affects not only Aztec but Noir as well(because Noir uses bb.js to prove). |
The issue from svelte that you linked is marked as "completed" but it's not solving anything. They just marked it as duplicate of vitejs/vite#2433 (which is still open) |
Gotcha. It seems the hobby plans just have 1GB RAM, I will take a look sometime |
@ludamad i believe you should avoid bundling WASM as an inline base64 url string. That's where the problem is. But not sure about Vite support of .wasm imports. It's not straightforward either. Though situation |
Meanwhile, I created a vite plugin that fixes bb.js by importing it from unpkg in production builds. |
@ludamad could you please at least not minify the js bundle of bb.js? It would then be possible to patch bb.js in userland. Add this to webpack config of bb.js. module.exports = {
//...
optimization: {
minimize: false,
},
}; |
Sorry is this related to the memory bug? |
@ludamad yes it is. If users can patch bb.js, vite will be able to build. A temporary workaround for a very cheap price |
Agree with @olehmisar! The |
@ludamad can this be prioritized, please? it's burning a lot of time for us devs building web stuff |
Fixed in aztec.js 0.64.0 |
Appreciate you checking and closing all these Oleh :) |
Building this simple file with vite fails because of out of memory error:
This issue first started happening in 0.35.0. It still persists in 0.40.1.
Full repro: https://github.com/ShieldSwap/aztec-build-out-of-memory-repro
Related vite issue: vitejs/vite#2433
Error logs
The text was updated successfully, but these errors were encountered: