R
Railway•16mo 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•16mo ago
Project ID: 32545448-aaa5-4244-804b-a690a9ace33d
npmrunstart
npmrunstart•16mo ago
32545448-aaa5-4244-804b-a690a9ace33d
Brody
Brody•16mo ago
can you try adding --host 0.0.0.0 to your start command? before the port flag is used
npmrunstart
npmrunstart•16mo ago
Thanks @Brody, just tried and still not working
Brody
Brody•16mo ago
what status code do you get?
Brody
Brody•16mo ago
show me the new logs please
npmrunstart
npmrunstart•16mo ago
@Brody
Brody
Brody•16mo ago
show me the railway.json file
npmrunstart
npmrunstart•16mo 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•16mo ago
try this?
npmrunstart
npmrunstart•16mo 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•16mo 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