Deploy Keeps failing despite trying out all the solutions on forum

My build process for my react dapp keeps failing. Previously changing to CI= npm run build in build settings and adding CI:false as env used to work. This time it didn’t.

Gave me error: Reached heap limit Allocation failed - JavaScript heap out of memory
So I added the env NODE_OPTIONS : --max_old_space_size=4096 to my netlify env’s.
On doing that it gives the following error:
The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.

Full Build log:

Can someone please point to a solution?

Hey @zubin

Have you read through [Support Guide] Making sure your builds use appropriate resources for Netlify's build system and [Support Guide] What can I do if my build fails for memory-overallocation-related errors?

I notice there is a build directory in the repository which indicates you have done a local build. You could build locally (I assume that works) push to origin and deploy the build directory instead of having Netlify to the building.


@coelmay thanks a ton. Dragging and dropping worked. However its not a solution because the react router doesnt work so only the home page shows up. and no other pages.

Tried modifying package.json in all sorts of ways.
Added "start": "react-scripts --max_old_space_size=4096 start", "build": "react-scripts --max_old_space_size=4096 build",
Nothing seems to help.

I have successfully dragged n dropped the build folder, but any idea why nothing other than the home page works? How do I ensure other sections which use router work too.

Changing it to "start": "react-scripts --max_old_space_size=3071 start", "build": "react-scripts --max_old_space_size=3071 build", helped. But my router is still not functioning (links to other pages wont open) and as usual tailwind.config has a problem coz no tailwind theme is being implemented.

1 Like