You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
A lot of users struggle understanding why a Node.js process exits while a promise is still runningnot yet resolved (see e.g., nodejs/node#22088).
This is by design but the question is if it's really the best for most users. It definitely complicates debugging some cases.
I wonder if it makes sense to try to improve the situation for users by e.g., adding an opt-in to either
keep the process running if promises are still runningunresolved (likely a bad idea)
provide a warning on process exit about still runningunresolved promises
exit with a non zero exit code in case promises are runningunresolved
tbd
Adding such an opt-in feature would likely help debugging never resolving promises and stream based promises where the stream does not receive any data.
Example:
// Never resolves(asyncfunctionfn(){awaitnewPromise((resolve)=>{});console.log('Will not be reached');})();