When I deploy my react js app into cloud run I found error returned FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
I set NODE_OPTIONS with max-old-space but still not working ,
is there way to do this with cloud run dashboard
Solved! Go to Solution.
Hi @Ahmed_Samir,
Welcome to Google Cloud Community!
I understand that you are getting an error when trying to deploy ReactJS into Cloud Run. May I know how you set the NODE_OPTIONS="--max-old-space-size=<MB>" flag? Also, you can try to gradually increase the memory size of it. This error usually occurs when the NodeJS process runs out of memory.
Regarding if there is a way to do this on Cloud Run. What you can do is to try to gradually increase the memory allocated to instances of the container from 512MB to 4GB. But, please take note also that increasing the memory will increase the pricing of your Cloud Run service.
I hope the above information is helpful.
Hi @Ahmed_Samir,
Welcome to Google Cloud Community!
I understand that you are getting an error when trying to deploy ReactJS into Cloud Run. May I know how you set the NODE_OPTIONS="--max-old-space-size=<MB>" flag? Also, you can try to gradually increase the memory size of it. This error usually occurs when the NodeJS process runs out of memory.
Regarding if there is a way to do this on Cloud Run. What you can do is to try to gradually increase the memory allocated to instances of the container from 512MB to 4GB. But, please take note also that increasing the memory will increase the pricing of your Cloud Run service.
I hope the above information is helpful.
Hi @ronnelg
I set it as NODE_OPTIONS="--max-old-space-size=<MB> into trigger Yaml file and into app service yaml file , didn't work
so I found the solution to set it into package.json into build command as "--max-old-space-size=<MB>" directly without NODE_OPTIONS , after investigation I found that NODE_OPTIONS=--max-old-space-size=<MB> not working into linux