Let’s review how event loop schedules resolved/rejected promises (including native JS promises, Q promises, and Bluebird promises) and next tick callbacks.
Therefore, it is quite clear that each unhandled promise is a potential problem delaying garbage collector from freeing memory. If references to the promise are kept around as well, we are going to leak the memory used by the promise object. Further, missing handlers break promise chains making the code unreliable.
Plugging Unhandled Promise Rejection
If you want to proof Node.JS applications against unhandled promise rejection, one of the simplest ways is by extending your code with the below:
Now, if there will ever be an unhandled promise in the code path, the application will crash providing us with a stacktrace. Using that trace, we could plug each leak, eventually getting to the point when all promises are handled correctly.