NextJS turborepo

Hi I have a turbo monorepo with a Next app I am trying to deploy. The app builds and deploys fine but i cant access the site at the url. In the logs im not sure if its related but I can see an:  ELIFECYCLE  Command failed. The app works fine on vercel, not sure if i need to make changes to get it to work on railway.
24 Replies
Percy
Percy5mo ago
Project ID: 1fa2ba21-add1-4880-9d28-b569b2ff6470
really_dizzy
really_dizzyOP5mo ago
1fa2ba21-add1-4880-9d28-b569b2ff6470 if i run railway run pnpm build railway run pnpm start it works locally it seems to dectect next server running at port 3000 when i click generate domain but then i get, application failed to respond when i click into it site:start: ✓ Ready in 400ms container event container died  ELIFECYCLE  Command failed. site:start:  ELIFECYCLE  Command failed. ERROR run failed: command exited (1)
Duchess
Duchess5mo ago
New reply sent from Help Station thread:
Suggest you to follow this template as reference for confighttps://github.com/railwayapp-templates/nextjs-prisma/tree/mainAlso, remember to set the defined build and start commands on service settings, as usual next deault package comes with different command names.
You're seeing this because this thread has been automatically linked to the Help Station thread. New reply sent from Help Station thread:
Pay attention to the start command at the example. The PORT env variable interpolation.
You're seeing this because this thread has been automatically linked to the Help Station thread.
Brody
Brody5mo ago
are you in the root of the project when you run these commands?
really_dizzy
really_dizzyOP5mo ago
yes in the root of the project tried setting next start --port ${PORT-3000} but still no luck
Brody
Brody5mo ago
please send your deployment logs - https://bookmarklets.up.railway.app/log-downloader/
really_dizzy
really_dizzyOP5mo ago
FYI those invalid next config options are not the cause of any issues since they come up when its working
Brody
Brody5mo ago
I'm not seeing any errors in those logs, what's not working?
really_dizzy
really_dizzyOP5mo ago
thats my problem there is no error but im getting:
No description
Brody
Brody5mo ago
can you try setting a HOSTNAME variable to 0.0.0.0
really_dizzy
really_dizzyOP5mo ago
still the same unfortunately
Brody
Brody5mo ago
deployment logs please
Brody
Brody5mo ago
send your next.config.js file
really_dizzy
really_dizzyOP5mo ago
const { withPayload } = require('@payloadcms/next/withPayload') / @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, // images: { // domains: [ // "res.cloudinary.com", // "images.pexels.com", // "placeimg.com", // "placehold.co", // "via.placeholder.com", // "nursify.vercel.app", // ], // }, images: { remotePatterns: [ { protocol: "https", hostname: "", }, { protocol: "http", hostname: "**", }, ], }, typescript: { // !! WARN !! // Dangerously allow production builds to successfully complete even if // your project has type errors. // !! WARN !! ignoreBuildErrors: true, }, }; module.exports = withPayload(nextConfig);
Brody
Brody5mo ago
can you add -H 0.0.0.0 into your start command
really_dizzy
really_dizzyOP5mo ago
so should be = "start": "next start -H 0.0.0.0 --port ${PORT-3000}", ?
really_dizzy
really_dizzyOP5mo ago
still no luck
Brody
Brody5mo ago
show me your public networking section of the settings
really_dizzy
really_dizzyOP5mo ago
its just started working
No description
really_dizzy
really_dizzyOP5mo ago
that last change might have been it, just might have needed time to update Thank you!!!!
Brody
Brody5mo ago
no problem!
Want results from more Discord servers?
Add your server