deploy logs say nuxt "start" is an unknown command. Production and development sites both crashed.
π«
Solution:Jump to solution
yes
nuxt start
starts a development / preview app, definitely dont want to be running that in production, make sure your build command is nuxt build
and your start command is node .output/server/index.mjs
make sure you set these commands in the scripts
portion of your package.json
and clear any build or start commands you may have set in your service settings...29 Replies
Project ID:
c456ec14-dbcb-44b0-8e8f-2c97ee12bf57
c456ec14-dbcb-44b0-8e8f-2c97ee12bf57
I pushed a navigation bugfix and everything was working beautifully as of ... 3 hours ago. My test users came back and gave production a green light. I have been referencing pages on prod since then. At just about an hour ago, the site started looking weird and then crashed.
I have tried redeploying and this is what I'm seeing in logs.
doesn't
nuxt start
start a development server?I'm runnign this in my test environment right now. I'll check prod ...
hmmmmm And it's the same issue in prod. but my node_env is set to production ... I'm looking again at my node deployment.
And no nuxt start starts the server for production as well.
nuxt 3 or 2?
I'm running 3
good choice
my first nuxt3 app so maybe I'm wrong.
i am in the process of confirming this
Thanks for helping. We have an event running and people can't access our event page. π¦
i cant find the nuxt cli docs lol
link me if you can find it
.... looking now too
what I don't get is why the site was deployed and running fine. And three hours later it crashes and I start seeing these problems. It's been live on Railway for over a month with no changes to deployment.
Solution
yes
nuxt start
starts a development / preview app, definitely dont want to be running that in production, make sure your build command is nuxt build
and your start command is node .output/server/index.mjs
make sure you set these commands in the scripts
portion of your package.json
and clear any build or start commands you may have set in your service settingsOkay I will try that now ...
if it still doesnt work, please send me your package.json as a file
okay create a script with the line you indicated above "prodserve": "node output/server/index.mjs" in my package.json . and updated my deploy setting for the "Start Command" to be "npm start prodserve" pushing develop to get the deploy triggered in my test env.
not really what i said to do lol
?
give this another read over
1. build command is nuxt build --- it is
2. start command is node output/server/index.mjs --- which it now is in a script entry I called "prodserve" in my package.json
3. "make sure you set these commands in the scripts portion of your package.json" -- exactly what is in 1 & 2 above
4. is it just the clearing out of the start and build commands? - I cleared out the npm run start entry and replaced it with prodserve
However my last test build succeeded and the site is running. I'll try that in prod.
However my last test build succeeded and the site is running. I'll try that in prod.
I did ask you to name it start for a reason, it works the same in the end though I guess
BTW ... we missed a "." in the start script . lol it's actually 'node .output/server/index.mjs'
good catch on that one
resolved?
I get where you were going with replacing actual "start"
So if I leave those settings blank in the deployment settings, then the deploy will look for standard scripts like "start" and "build"?
Prod is up! Yes, resolved. Thank you!
correct, but you have it named
prodserve
and that's why I asked you to name it start
understood
Thank you for your help.
no problem π
don't worry, I added the period