10 months ago
I tried to deploy my react front end app and it crashed after like 5mn. how can I avoid that?
7 Replies
okay thank you for the credits, can anyone help me on how to use them please? Do I still need to put a credit card to use it?
Because from what the site says, my card does not support this type of purchase
10 months ago
If your react project is crashing, something is likely misconfigured. Please share your logs
Is says memory heap issue, I tried on vercel and it works perfectly fine
10 months ago
Use a Static Build for React
React apps (not Next.js) should usually be built and served as static files, not via npm run start.
Steps:
a. Change your package.json:
"scripts": {
"start": "serve -s build", // static file serving
"build": "react-scripts build"
}
> Requires serve package:
npm install --save serve
b. Railway Deploy Settings:
Build Command:
npm install && npm run build
Start Command:
npm run start
This will serve your build/ folder as static files instead
of running a heavy dev server.
10 months ago
Again, please share your logs here