#Nextjs deployment with standalone output results in server error page

9 messages · Page 1 of 1 (latest)

copper lance
#

I am deploying a nextjs application from a github repo and it works well with the normal "next start" command. However, I want to make use of the next standalone output. Adding output: "standalone" to the next config file results in the following warning: "next start" does not work with "output: standalone" configuration. Use "node .next/standalone/server.js" instead..

So then I created a new script command: "railway": "node .next/standalone/server.js" and added npm run railway as the new start command for the service. However this results in the public railway domain going to a railway error page.

Here are the logs on redeploy:

drowsy cairnBOT
#

Project ID: bc89077a-09e0-4e2e-99a9-16c25f87a05d

copper lance
#

bc89077a-09e0-4e2e-99a9-16c25f87a05d

#

Nextjs deployment with standalone output results in server error page

mystic lodge
#

try setting a HOSTNAME service variable to 0.0.0.0

as for the sigterm error, you would want to set your start command to node .next/standalone/server.js in the service settings, this is because npm does not pass down sigterm properly.

copper lance
mystic lodge
#

that's from your old deployment where you were still using npm

copper lance
#

Okay, yeah, seems I needed to redeploy again for the changes to take effect. Working now.
Thanks!

mystic lodge
#

no problem!