#goddamnitjavascript
Explore tagged Tumblr posts
Text
Node Server Crashing At Launch
Problem 1 = Too many processes
One of my side projects suddenly started crashing whenever I would launch the Node server. No error, no message, just stop cold. At first, it was only one of two projects that had a bunch of shared dependencies. So naturally I assumed it was something specific to that API. I spent hours trying to figure it out - the other service continued to work every time I rebooted it.
Turns out the problem wasn’t the code at all. For some reason, Node doesn’t terminate correctly 100% of the time, leaving ghost instances running in the background. Eventually, they start to compete for resources and your new servers can’t get any threads to run!
Solution = turn it on and off again by rebooting your computer..
Problem 2: Circular references
Check your references - it’s really helpful to use the delta tool in VS code and see where references were added. In my case, I had a class referencing itself...
0 notes