#I have problems deploying my react app, can someone pls help me
1 messages · Page 1 of 1 (latest)
i use railway.app so i do not know
"scripts": {
"start": "react-scripts --max_old_space_size=4096 start",
"build": "react-scripts --max_old_space_size=4096 build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
adjust your scripts for whatever memory is available to you
i added this
i now get this 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.
npm WARN config production Use --omit=dev instead.
how do i know how much memory i need hahaha, sorry this is the first time im deploying something
idk railway app so idk but try smaller and work your way up
you could try googling how much RAM they make available to you
set it to like 400MB
maybe 300mb idk
depends on if your system resource usage counts or not
soo?
yeah same error
what did yoou set the size to? 300?
i did that using the enviroment variables like you you see in this image
try putting it in your package json at like 225
idk
512MB isnt much if theyre counting system resources
can someone else pls help if possible
out of memory
Problem is not necessarily your code, it's the framework and dependencies being pulled in. If you're using boilerplate code for the app and you don't have unnecessary dependencies then you just need to make your environment bigger.
To start with, the memory spec of --max-old-space-size=4096 was 4GB, since this parameter is in megabytes, not bytes. So if you only have 512mb of ram you cannot expect to support a heap size beyond 384mb considering you need the actual VM to function.
If you have adjusted your memory and you still crash then you clearly need a bigger VM to operate within. And then adjust your heap size accordingly.
does that mean if i use this one it should work?
Try using smaller environment with lower heap size (384) and if it still fails to start then, yeah it probably just has too many dependencies or the webpack stage just needs more than that.
In which case 8gb should be plenty.
But set heap size accordingly!
yeah already tried that didnt work
did you try with 256 or lower?
yes
i tried 256
but i didnt go lower
just checked
i did go lower
i tried 200 en 256
both didnt work
can you show the metrics tab?
can you control what os its running on/do you know what it is?
i do not know where i can find that information
Have no idea about railway, I would just use lightsail on aws for something simple - or just deploy a t2-micro instance on EC2
godaddy is cheap also but php normally