6aef4b8445
## New features - Example of how to use `Sentry.captureException()` in API routes5a35982717
## Bug fixes - Server-side source maps now work in Sentry when deployed to Vercel629a9ed504
- If uploading source maps, `Sentry.init()` now sets the `release`, so that exceptions are correctly associated with the source maps in that release ## Open issues ### `_error.js` is unused for `getServerSideProps` errors when deployed to Vercel Instead of rendering this example's overridden `_error.js` (like it does when testing locally with `NODE_ENV='production'`), when deployed to Vercel and an Error is thrown from `getServerSideProps`, this page is shown: ![Screenshot of Vercel Application Error page](https://user-images.githubusercontent.com/709153/90968889-aa3c3d00-e4a6-11ea-9eff-fafee3d1ff33.png) This confuses me because the Error is still successfully sent to Sentry, but I would've expected it to be sent by the call to `Sentry.captureException()` in `_error.js`. I'm not sure why it works. ### API test 2 & 3 don't work in the "server" build config They don't work when deployed to Vercel in the "serverless" config either, but that's expected because there aren't any handlers to flush the Sentry queue. I can't figure out why they don't work in the long-lived "server" config.
6 lines
170 B
JavaScript
6 lines
170 B
JavaScript
import Error from 'next/error'
|
|
|
|
export default function NotFound() {
|
|
// Opinionated: do not record an exception in Sentry for 404
|
|
return <Error statusCode={404} />
|
|
}
|