Cannot deploy Next.js app
mago
PROOP

a year ago

Deployment has crashed with the following error. How can I fix the issue? Since Railway doesn't provide SSH access, I have no idea to fix.

emergen-front@0.6.15 start

cp -r .next/static .next/standalone/.next/static && cp -r public .next/standalone/public && cross-env PORT=$npmconfigport HOSTNAME=$npmconfighost node .next/standalone/server.js

cp: cannot create directory '.next/standalone/.next/static': No such file or directory

container event container died

npm warn config production Use --omit=dev instead.

emergen-front@0.6.15 start

cp -r .next/static .next/standalone/.next/static && cp -r public .next/standalone/public && cross-env PORT=$npmconfigport HOSTNAME=$npmconfighost node .next/standalone/server.js

cp: cannot create directory '.next/standalone/.next/static': No such file or directory

container event container died

npm warn config production Use --omit=dev instead.

emergen-front@0.6.15 start

cp -r .next/static .next/standalone/.next/static && cp -r public .next/standalone/public && cross-env PORT=$npmconfigport HOSTNAME=$npmconfighost node .next/standalone/server.js

cp: cannot create directory '.next/standalone/.next/static': No such file or directory

container event container died

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

Solved

5 Replies

brody
EMPLOYEE

a year ago

Hey,

Can you share some more info on why you need to run cp in your start command? I'm missing a lot of context here that I would need to be able to help you.


Status changed to Awaiting User Response Railway over 1 year ago


mago
PROOP

a year ago

Hi, thanks for checking. I'm trying to deploy the Dify front app template below.
https://github.com/langgenius/webapp-text-generator

I could deployed to Vercel without any modification. But not sure why it cannot deploy smoothly on Railway.


Status changed to Awaiting Railway Response Railway over 1 year ago


brody
EMPLOYEE

a year ago

Unless I'm looking in the wrong place, I'm not seeing cp being used here?


Status changed to Awaiting User Response Railway over 1 year ago


mago
PROOP

a year ago

Yes, you're right! I've miss-pasted package.json from the other repo. Fixed the code and succeeded to deploy!


Status changed to Awaiting Railway Response Railway over 1 year ago


brody
EMPLOYEE

a year ago

Awsome!


Status changed to Awaiting User Response Railway over 1 year ago


Status changed to Solved brody over 1 year ago


Loading...