rsnext/examples/with-sentry/utils
Weston Thayer 6aef4b8445
Update with-sentry example to show how to track API routes + bug fixes (#16484)
## New features

- Example of how to use `Sentry.captureException()` in API routes 5a35982717

## Bug fixes

- Server-side source maps now work in Sentry when deployed to Vercel 629a9ed504
- 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.
2020-11-09 18:36:36 +00:00
..
sentry.js Update with-sentry example to show how to track API routes + bug fixes (#16484) 2020-11-09 18:36:36 +00:00