R
Railway14mo ago
YJ ㊫

How do we handle nodejs app crashes with Railway ?

Just trying to fix this issue. I think I have to remove nodemon from the general dependencies and add them to dev dependencies.
No description
Solution:
I can't believe that worked nodemon should work in prod ( definitally not recommended though ) oh well, if it works it works...
Jump to solution
20 Replies
Percy
Percy14mo ago
Project ID: 2857c8f8-a68c-485d-98fa-3a2df426f138
YJ ㊫
YJ ㊫OP14mo ago
2857c8f8-a68c-485d-98fa-3a2df426f138
Fragly
Fragly14mo ago
why does it crash? is that all the logs? from that first line, it kinda gives me the impression that something is not compatible with the current version of nodejs just a hunch though, we can make sure if you send all the logs
YJ ㊫
YJ ㊫OP14mo ago
hey sorry I had to remove nodemon from script like you said
Fragly
Fragly14mo ago
that fixed it?? :o
YJ ㊫
YJ ㊫OP14mo ago
I removed it and tried again
No description
YJ ㊫
YJ ㊫OP14mo ago
yeah lol thank you! Sorry for wasting your time
Solution
Fragly
Fragly14mo ago
I can't believe that worked nodemon should work in prod ( definitally not recommended though ) oh well, if it works it works
YJ ㊫
YJ ㊫OP14mo ago
I havent thought about optimizing anything for prod
YJ ㊫
YJ ㊫OP14mo ago
before i only had 1 start
No description
YJ ㊫
YJ ㊫OP14mo ago
now I have start-dev and start
Fragly
Fragly14mo ago
yea, that's perfect
YJ ㊫
YJ ㊫OP14mo ago
Thank you!
Fragly
Fragly14mo ago
out of curiosity, what's the point of prestart? why not just run build directly? ( btw railway auto runs build for you )
YJ ㊫
YJ ㊫OP14mo ago
was using chatgpt no point lol 😂
Fragly
Fragly14mo ago
oh ok
YJ ㊫
YJ ㊫OP14mo ago
I wanted to ask if you have recommendations as well like how to optimize nodejs apps for prod
Fragly
Fragly14mo ago
as far as I know, as long as you're compiling your TS to JS in build and you're not using dev environment tools like nodemon to run your app, it should be fine for prod
YJ ㊫
YJ ㊫OP14mo ago
Thank you sir ! 😄
Fragly
Fragly14mo ago
np!
Want results from more Discord servers?
Add your server