R
Railway13mo 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
Percy13mo ago
Project ID: 2857c8f8-a68c-485d-98fa-3a2df426f138
YJ ㊫
YJ ㊫13mo ago
2857c8f8-a68c-485d-98fa-3a2df426f138
Fragly
Fragly13mo 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 ㊫13mo ago
hey sorry I had to remove nodemon from script like you said
Fragly
Fragly13mo ago
that fixed it?? :o
YJ ㊫
YJ ㊫13mo ago
I removed it and tried again
No description
YJ ㊫
YJ ㊫13mo ago
yeah lol thank you! Sorry for wasting your time
Solution
Fragly
Fragly13mo 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 ㊫13mo ago
I havent thought about optimizing anything for prod
YJ ㊫
YJ ㊫13mo ago
before i only had 1 start
No description
YJ ㊫
YJ ㊫13mo ago
now I have start-dev and start
Fragly
Fragly13mo ago
yea, that's perfect
YJ ㊫
YJ ㊫13mo ago
Thank you!
Fragly
Fragly13mo 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 ㊫13mo ago
was using chatgpt no point lol 😂
Fragly
Fragly13mo ago
oh ok
YJ ㊫
YJ ㊫13mo ago
I wanted to ask if you have recommendations as well like how to optimize nodejs apps for prod
Fragly
Fragly13mo 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 ㊫13mo ago
Thank you sir ! 😄
Fragly
Fragly13mo ago
np!
Want results from more Discord servers?
Add your server