Receiving "JavaScript heap out of memory" when nitro is building. The application built perviously.
Was there a recent update to nuxt or nitro or a dependency that can cause this. The application was building properly before, this issue was observed as of two days ago. The entire error is in the attachment.
<--- Last few GCs --->
[51779:0x150008000] 263322 ms: Mark-Compact 4014.1 (4129.9) -> 4010.2 (4143.6) MB, 3616.92 / 0.00 ms (average mu = 0.680, current mu = 0.209) allocation failure; scavenge might not succeed
[51779:0x150008000] 272034 ms: Mark-Compact 4026.2 (4143.9) -> 4015.6 (4145.4) MB, 8652.25 / 0.00 ms (average mu = 0.284, current mu = 0.007) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
6 Replies
Same problem here durint deployment with the latest nuxt version
I use
NODE_OPTIONS=--max_old_space_size=8192
to increase the heap memory, when running, nuxt build, nuxt generate, nuxt dev
Here is my package.json
depicting this.
Are you sure thats right?
You have to update your package.json file’s scripts section with the
dev
command I’ve shared.
Then execute npm run dev
from command line.That is what I did, and that is what shows up
Should this be in a git bash command line?
Use
cross-env
if you're not on a unix based system
Or set NODE_OPTIONS=... <command>
if you're on Windows