Prevent app from crashing on unhandled rejection

Context: https://github.com/remix-run/remix/issues/9178#issuecomment-2032102431
This commit is contained in:
Kalle
2024-04-14 11:02:29 +03:00
parent 53915f5c87
commit de504836a4

View File

@@ -178,3 +178,7 @@ if (!global.appStartSignal && process.env.NODE_ENV === "production") {
updatePatreonData().catch((err) => console.error(err)),
);
}
process.on("unhandledRejection", (reason: string, p: Promise<any>) => {
console.error("Unhandled Rejection at:", p, "reason:", reason);
});