onRequestError

A function exported from instrumentation.ts, added in Next.js 15, that receives every uncaught server error with request and route details.

In more detail

Next.js calls it with the error, the request and details such as the route and whether it was rendering or running an action. Send the error to your monitoring service from here to capture every server failure in one place.

Related terms

Taught in

References