R
Railway•2y ago
npmrunstart

Application failed to respond

My nx app get that error:
yarn run v1.22.19
$ nx serve app --prod --port 5564
> nx run app:serve:production --port 5564
info - Loaded env from /app/packages/app/.env.local
[ ready ] on http://localhost:5564
yarn run v1.22.19
$ nx serve app --prod --port 5564
> nx run app:serve:production --port 5564
info - Loaded env from /app/packages/app/.env.local
[ ready ] on http://localhost:5564
nix packs configuration:
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "yarn build app --prod"
},
"deploy": {
"numReplicas": 1,
"startCommand": "yarn start app --prod --port ${PORT-3001}",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "yarn build app --prod"
},
"deploy": {
"numReplicas": 1,
"startCommand": "yarn start app --prod --port ${PORT-3001}",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
13 Replies
Percy
Percy•2y ago
Project ID: 32545448-aaa5-4244-804b-a690a9ace33d
npmrunstart
npmrunstartOP•2y ago
32545448-aaa5-4244-804b-a690a9ace33d
Brody
Brody•2y ago
can you try adding --host 0.0.0.0 to your start command? before the port flag is used
npmrunstart
npmrunstartOP•2y ago
Thanks @Brody, just tried and still not working
Brody
Brody•2y ago
what status code do you get?
Brody
Brody•2y ago
show me the new logs please
npmrunstart
npmrunstartOP•2y ago
@Brody
Brody
Brody•2y ago
show me the railway.json file
npmrunstart
npmrunstartOP•2y ago
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "yarn build app --prod"
},
"deploy": {
"numReplicas": 1,
"startCommand": "yarn start app --prod --port ${PORT-3001} --host=0.0.0.0",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "yarn build app --prod"
},
"deploy": {
"numReplicas": 1,
"startCommand": "yarn start app --prod --port ${PORT-3001} --host=0.0.0.0",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
Brody
Brody•2y ago
try this?
npmrunstart
npmrunstartOP•2y ago
Omg @Brody 😂😂 thank you so much, you saved my night Still not working @Brody
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "yarn build app --prod"
},
"deploy": {
"numReplicas": 1,
"startCommand": "yarn start app --host 0.0.0.0 --port ${PORT-3001} --prod",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "yarn build app --prod"
},
"deploy": {
"numReplicas": 1,
"startCommand": "yarn start app --host 0.0.0.0 --port ${PORT-3001} --prod",
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
yarn run v1.22.19
$ nx serve app --host 0.0.0.0 --port 5438 --prod
> nx run app:serve:production --host 0.0.0.0 --port 5438
info - Loaded env from /app/packages/app/.env.local
[ ready ] on http://localhost:5438
yarn run v1.22.19
$ nx serve app --host 0.0.0.0 --port 5438 --prod
> nx run app:serve:production --host 0.0.0.0 --port 5438
info - Loaded env from /app/packages/app/.env.local
[ ready ] on http://localhost:5438
Problem solved, should be: nx serve app --hostname 0.0.0.0 --port 5438 --prod 🎉🎉
Brody
Brody•2y ago
hehe I took a guess at --host, nx's docs page was frozen for me glad you could solve it!
Want results from more Discord servers?
Add your server