Commit graph

18 commits

Author SHA1 Message Date
Jon Espen Kvisler
31d83852f8
Sentry example: add js types to SentryWebpackPluginOptions (#28726)
* 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
2022-02-21 21:51:36 +01:00
Katie Byers
cee1565688
fix(with-sentry example): Small tweaks (#28359)
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.
2021-09-17 14:14:52 +00:00
iker barriocanal
4bc87e479c
Update example with-sentry (#24819)
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.
2021-05-07 12:52:03 +00:00
Ciprian Caba
919ac17f76
Update reference to commit sha (#23215)
VERCEL_GIT_COMMIT_SHA is now available by default across all integrations
2021-03-19 16:49:20 +00:00
Luke Harries
16d464caf6
Fix withSourceMaps is not a function (#20643)
In order to get this example working, I needed to remove the invocation as described here: https://github.com/vercel/next-plugins/issues/309#issuecomment-674376348
2020-12-31 22:00:41 +00:00
Vishnu Paduchuri
17b91e7c76
Spelling fix (#19686) 2020-11-30 18:53:13 +00:00
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
WeichienHung
c97e53efe1
basePath should also append in urlPrefix (#16376)
Fix https://github.com/vercel/next.js/issues/16197

See my screenshot. Testing url is changed to http://localhost:3000/test and can find the source map.
<img width="826" alt="圖片" src="https://user-images.githubusercontent.com/1462027/90737991-d74eeb00-e300-11ea-9675-f25aef6a4062.png">
2020-08-24 02:00:43 +00:00
Andrew Nagy
2301331703
Add stripPrefix of webpack://_N_E/ (#15955)
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 (?)
2020-08-11 17:49:34 +00:00
Kazuhito Hokamura
7a9ee4b9e5
Update Sentry example to improve display of server errors (#15495)
In the Sentry example, sourcemaps is not enabled in server error.

I solved this problem by using `RewriteFrames`. On the client side, the sourcemaps path is `~/_next`, but on the server side it needs to be `~/.next` (distDir), so I rewrite it using the `iteratee`.

ref. https://docs.sentry.io/platforms/node/sourcemaps/#updating-sentry-sdk-configuration-to-support-source-maps

-----

## before
<img width="983" alt="ss2" src="https://user-images.githubusercontent.com/39471/88479997-29188580-cf8e-11ea-8d16-10ccfa6fc1a4.png">

## after
<img width="989" alt="ss1" src="https://user-images.githubusercontent.com/39471/88479995-26b62b80-cf8e-11ea-8b1f-7784b32b9e6d.png">
2020-08-07 07:22:08 +00:00
Colleen O'Rourke
23ebe3e4aa
Update Sentry example for use with Sentry/Vercel integration (#15349)
* 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>
2020-07-23 16:32:44 -05:00
Obed Marquez Parlapiano
5a00d62242
Correct order of packages in Sentry example explanation (#15334) 2020-07-20 14:46:25 -04:00
stefanprobst
279ae19c7e
docs: update links to docs site (#14305)
this updates some links to the docs site to their new location
2020-06-18 09:54:07 +00:00
Todor Totev
47e2beba20
[Example] Deprecate with-sentry in favor of with-sentry-simple (#13904)
Co-authored-by: Luis Alvarez D <luis@vercel.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-06-08 21:32:23 -04:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
Jess Telford
09508ed4bb [with-sentry] Use env config instead of webpack where possible (#6381) 2019-02-21 00:33:32 +01:00
Jess Telford
ecbecb9edb Fixes for with-sentry example (#6362) 2019-02-20 14:49:16 +01:00
Adam Stankiewicz
cd1d3640a9 Improve with-sentry example (#5727)
* 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
2018-12-10 23:59:12 +01:00