I’m using the App Router from NextJS >13. Trying to figure out how to automatically log all uncaught errors in API route handlers to Winston. I tried process.on("uncaughtException", ...)
and process.on("unhandledRejection", ...)
but these events don’t seem to be generated by errors inside a POST
method in a route.ts
file.