10 months ago
We are unable to deploy nextjs app, its under web folder of a monorepo.
2 Replies
10 months ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 Trouble with Next.js app migration
- 🧵 Why nixpacks.toml is ignored?
- 🧵 NextJS not starting correctly in our latest deployment
- 🧵 Railway internal build caching issue
If you find the answer from one of these, please let us know by solving the thread!
10 months ago
This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.
Status changed to Open brody • 10 months ago
10 months ago
- Tell Railway to use
web/as your app root In your Railway project → Settings → Deployment → Root Directory, set:
web - Set your Build & Start commands Still under Deployment, update:
Build Command: npm install && npm run build
Start Command: npm run start - Ensure your
web/package.jsonhas the right scripts
{
"scripts": {
"build": "next build",
"start": "next start"
}
} (Railway will run those from inside web/, so it will find package.json and produce the .next folder.)
4. Redeploy
Hit Deploy (or push a dummy commit). You should see
› Building… › Production build in .next ready › Starting… and your app will go live.
That’s it—no extra Dockerfiles or hacks. Railway will look under web/, run npm run build, generate .next, then npm run start.