* Add js types to SentryWebpackPluginOptions
Enables code completion in Visual Studio Code (and perhaps other editors)
* Use partial type for SentryWebpackPluginOptions
This matches the expected type in e71454ef78/packages/nextjs/src/config/webpack.ts (L38)
* inline sentry config
This PR makes two changes:
- It updates the index page to reflect the fact that `withSentry` should now be working for API routes deployed to Vercel.
- It changes the route which returns a promise rejection to be more obvious about the fact that that's what it's doing.
The [official Sentry Next.js SDK](https://docs.sentry.io/platforms/javascript/guides/nextjs/) is now the recommended choice to use with Next.js, instead of the previous workarounds. This PR updates the example, which now uses the SDK.
## 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.
In with-sentry add stripPrefix of `webpack://_N_E/`. This removes the `webpack://_N_E/` prefix from the stack trace which will help Sentry to understand what is "App Only" vs "Full"
I'll fully tested calling errors in browser and the stack traces are still aligned and linked correctly. This just gets rid of the extra data in the front which seems to be the same for everyone and I believe it comes from webpack 5 (?)
* Update Sentry example for use with Sentry/Vercel integration
* update linting
* Update link in readme
* Update readme, add comment
* Add step about commit SHA
* Updated readme
* Use if
* dont call sentry webpack plugin w/o a commit sha present
* Update examples/with-sentry/README.md
Co-authored-by: Luis Alvarez D. <luis@vercel.com>
* update release value
* prettier readme
* Updated note
Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* Improve with-sentry example
* remove nonexisting keys from request and update errorInfo handling
* readd query and pathname
* read query and params and add pathname and query to client