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
Uncaught errors in API routes or middleware functions are not reported, because they reach our custom _error.js handler with status code 404 and have no context of the error.
Note: When using Pages Router these errors are not reported at all.
Note: When using App Router these errors are reported, either caught with the global window.onerror handler or with a very generic message.
Possible solution
Wrap all middleware functions and api handlers with a try/catch block that reports to Honeybadger. It would be great to do transparently with webpack rather than asking users to wrap all their functions with a try/catch (or a Honeybadger utility method).
TODO
Remove from limitations section in nextjs docs page and nextjs repo readme file when this is fixed.
Pages Router: Uncaught errors in API routes are reported to Honeybadger
Pages Router: Uncaught errors in middleware functions are reported to Honeybadger
App Router: Server errors are reported as expected, instead of a generic error message
The text was updated successfully, but these errors were encountered:
Description
Uncaught errors in API routes or middleware functions are not reported, because they reach our custom
_error.js
handler with status code 404 and have no context of the error.Note: When using Pages Router these errors are not reported at all.
Note: When using App Router these errors are reported, either caught with the global
window.onerror
handler or with a very generic message.Possible solution
TODO
The text was updated successfully, but these errors were encountered: