Skip to content
This repository was archived by the owner on May 18, 2023. It is now read-only.

Commit c311967

Browse files
committed
chore: bump sentry to v7 and reset based on example
1 parent 899fe3a commit c311967

6 files changed

+94
-119
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@
9292
"@popperjs/core": "^2.10.0",
9393
"@ramp-network/ramp-instant-sdk": "^2.5.0",
9494
"@reduxjs/toolkit": "^1.8.0",
95-
"@sentry/nextjs": "^6.19.7",
96-
"@sentry/react": "^6.19.7",
97-
"@sentry/tracing": "^6.19.7",
95+
"@sentry/nextjs": "^7.0.0",
96+
"@sentry/react": "^7.0.0",
97+
"@sentry/tracing": "^7.0.0",
9898
"@sushiswap/bentobox-sdk": "1.0.0-canary.89",
9999
"@sushiswap/chainlink-whitelist": "0.2.8",
100100
"@sushiswap/core": "^2.0.0-canary.1",

sentry.client.config.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@
22
// The config you add here will be used whenever a page is visited.
33
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
44

5-
import * as Sentry from '@sentry/nextjs'
5+
import * as Sentry from '@sentry/nextjs';
6+
67
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN
8+
79
Sentry.init({
810
dsn: SENTRY_DSN,
911
tracesSampleRate: 1.0,
10-
// ...
1112
// Note: if you want to override the automatic release value, do not set a
1213
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
1314
// that it will also get attached to your source maps
14-
15-
// beforeSend(event, hint) {
16-
// // Check if it is an exception, and if so, show the report dialog
17-
// if (event.exception) {
18-
// Sentry.showReportDialog({ eventId: event.event_id })
19-
// }
20-
// return event
21-
// },
2215
})

sentry.server.config.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN
88

99
Sentry.init({
1010
dsn: SENTRY_DSN,
11-
// Adjust this value in production, or use tracesSampler for greater control
1211
tracesSampleRate: 1.0,
13-
// ...
1412
// Note: if you want to override the automatic release value, do not set a
1513
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
1614
// that it will also get attached to your source maps
17-
})
15+
})

src/pages/_app.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ function MyApp({ Component, pageProps, fallback, err }) {
170170
<Guard>
171171
{/*@ts-ignore TYPE NEEDS FIXING*/}
172172
<DefaultSeo {...SEO} />
173+
{/* Workaround for https://github.com/vercel/next.js/issues/8592 */}
173174
<Component {...pageProps} err={err} />
174175
</Guard>
175176
</Layout>

src/pages/_error.tsx

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import * as Sentry from '@sentry/nextjs'
21
import NextErrorComponent from 'next/error'
32

4-
// @ts-ignore
3+
import * as Sentry from '@sentry/nextjs'
4+
55
const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => {
66
if (!hasGetInitialPropsRun && err) {
77
// getInitialProps is not called in case of
@@ -14,17 +14,14 @@ const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => {
1414
return <NextErrorComponent statusCode={statusCode} />
1515
}
1616

17-
// @ts-ignore
18-
MyError.getInitialProps = async ({ res, err, asPath }) => {
19-
// @ts-ignore
17+
MyError.getInitialProps = async ({ res, err }) => {
2018
const errorInitialProps = await NextErrorComponent.getInitialProps({
2119
res,
2220
err,
2321
})
2422

2523
// Workaround for https://github.com/vercel/next.js/issues/8592, mark when
2624
// getInitialProps has run
27-
// @ts-ignore
2825
errorInitialProps.hasGetInitialPropsRun = true
2926

3027
// Running on the server, the response object (`res`) is available.
@@ -51,11 +48,8 @@ MyError.getInitialProps = async ({ res, err, asPath }) => {
5148
}
5249

5350
// If this point is reached, getInitialProps was called without any
54-
// information about what the error might be. This is unexpected and may
55-
// indicate a bug introduced in Next.js, so record it in Sentry
56-
Sentry.captureException(new Error(`_error.js getInitialProps missing data at path: ${asPath}`))
57-
await Sentry.flush(2000)
58-
51+
// information about what the error might be. This can be caused by
52+
// a falsy value being thrown e.g. throw undefined
5953
return errorInitialProps
6054
}
6155

yarn.lock

+81-92
Original file line numberDiff line numberDiff line change
@@ -2408,20 +2408,20 @@
24082408
resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.3.tgz#6801033be7ff87a6b7cadaf5b337c9f366a3c4b0"
24092409
integrity sha512-WiBSI6JBIhC6LRIsB2Kwh8DsGTlbBU+mLRxJmAe3LjHTdkDpwIbEOZgoXBbZilk/vlfjK8i6nKRAvIRn1XaIMw==
24102410

2411-
"@sentry/browser@6.19.7":
2412-
version "6.19.7"
2413-
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.19.7.tgz#a40b6b72d911b5f1ed70ed3b4e7d4d4e625c0b5f"
2414-
integrity sha512-oDbklp4O3MtAM4mtuwyZLrgO1qDVYIujzNJQzXmi9YzymJCuzMLSRDvhY83NNDCRxf0pds4DShgYeZdbSyKraA==
2415-
dependencies:
2416-
"@sentry/core" "6.19.7"
2417-
"@sentry/types" "6.19.7"
2418-
"@sentry/utils" "6.19.7"
2411+
"@sentry/browser@7.0.0":
2412+
version "7.0.0"
2413+
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.0.0.tgz#c26517d9e88215494cf3a196903eafe64170f494"
2414+
integrity sha512-XJeQA/CIocrmShpfVcccJ2RvZbWZy+OustSbgLP5Vk+ZnzbqKQo1zQ92jO/dUoVIsl5dWpUaOKfT6gXmORf4vQ==
2415+
dependencies:
2416+
"@sentry/core" "7.0.0"
2417+
"@sentry/types" "7.0.0"
2418+
"@sentry/utils" "7.0.0"
24192419
tslib "^1.9.3"
24202420

2421-
"@sentry/cli@^1.73.0":
2422-
version "1.74.3"
2423-
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.74.3.tgz#8405a19f6bb21b2ff3d051fb8a18056cc796c5ae"
2424-
integrity sha512-74NiqWTgTFDPe2S99h1ge5UMe6aAC44ebareadd1P6MdaNfYz6JUEa2QrDfMq7TKccEiRFXhXBHbUI8mxzrzuQ==
2421+
"@sentry/cli@^1.74.4":
2422+
version "1.74.4"
2423+
resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-1.74.4.tgz#7df82f68045a155e1885bfcbb5d303e5259eb18e"
2424+
integrity sha512-BMfzYiedbModsNBJlKeBOLVYUtwSi99LJ8gxxE4Bp5N8hyjNIN0WVrozAVZ27mqzAuy6151Za3dpmOLO86YlGw==
24252425
dependencies:
24262426
https-proxy-agent "^5.0.0"
24272427
mkdirp "^0.5.5"
@@ -2431,116 +2431,105 @@
24312431
proxy-from-env "^1.1.0"
24322432
which "^2.0.2"
24332433

2434-
"@sentry/core@6.19.7":
2435-
version "6.19.7"
2436-
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-6.19.7.tgz#156aaa56dd7fad8c89c145be6ad7a4f7209f9785"
2437-
integrity sha512-tOfZ/umqB2AcHPGbIrsFLcvApdTm9ggpi/kQZFkej7kMphjT+SGBiQfYtjyg9jcRW+ilAR4JXC9BGKsdEQ+8Vw==
2434+
"@sentry/core@7.0.0":
2435+
version "7.0.0"
2436+
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.0.0.tgz#8514aad3ad81ce018e1d4a956407530a8c1286d0"
2437+
integrity sha512-Wl7MjmahLhuzzByYiWaYTeHKQfF6usnMp+rTTYTBbneuM4MD7TikRt6ybgnxqyqR7nI7ADH/U8OljtiqwnsOcw==
24382438
dependencies:
2439-
"@sentry/hub" "6.19.7"
2440-
"@sentry/minimal" "6.19.7"
2441-
"@sentry/types" "6.19.7"
2442-
"@sentry/utils" "6.19.7"
2439+
"@sentry/hub" "7.0.0"
2440+
"@sentry/types" "7.0.0"
2441+
"@sentry/utils" "7.0.0"
24432442
tslib "^1.9.3"
24442443

2445-
"@sentry/hub@6.19.7":
2446-
version "6.19.7"
2447-
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-6.19.7.tgz#58ad7776bbd31e9596a8ec46365b45cd8b9cfd11"
2448-
integrity sha512-y3OtbYFAqKHCWezF0EGGr5lcyI2KbaXW2Ik7Xp8Mu9TxbSTuwTe4rTntwg8ngPjUQU3SUHzgjqVB8qjiGqFXCA==
2444+
"@sentry/hub@7.0.0":
2445+
version "7.0.0"
2446+
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-7.0.0.tgz#9ffcea4ae497d9e8440683bdc72eb4b30f20d24d"
2447+
integrity sha512-my4s+SPZiL6BKOK89YNk74QFRejlwVKKSetzz+Wr1cxDLbGXOIHS3uRJlagqOpfthhD1dq8m3WBQnabPf5JlHQ==
24492448
dependencies:
2450-
"@sentry/types" "6.19.7"
2451-
"@sentry/utils" "6.19.7"
2449+
"@sentry/types" "7.0.0"
2450+
"@sentry/utils" "7.0.0"
24522451
tslib "^1.9.3"
24532452

2454-
"@sentry/integrations@6.19.7":
2455-
version "6.19.7"
2456-
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-6.19.7.tgz#e6e126b692077c8731644224c754012bed65b425"
2457-
integrity sha512-yNeeFyuygJaV7Mdc5qWuDa13xVj5mVdECaaw2Xs4pfeHaXmRfRzZY17N8ypWFegKWxKBHynyQRMD10W5pBwJvA==
2453+
"@sentry/integrations@7.0.0":
2454+
version "7.0.0"
2455+
resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.0.0.tgz#89e5008b474c0221ab75f0ad4fbc24f56204c8a1"
2456+
integrity sha512-5/JqYIBpe6lxMqxjsBr2NB2oWPe+46xolcXYSvgUYI7vryIiyW+jhXINma1hEPxXDHntiYN9aT4xzFgdNv1MHA==
24582457
dependencies:
2459-
"@sentry/types" "6.19.7"
2460-
"@sentry/utils" "6.19.7"
2458+
"@sentry/types" "7.0.0"
2459+
"@sentry/utils" "7.0.0"
24612460
localforage "^1.8.1"
24622461
tslib "^1.9.3"
24632462

2464-
"@sentry/minimal@6.19.7":
2465-
version "6.19.7"
2466-
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-6.19.7.tgz#b3ee46d6abef9ef3dd4837ebcb6bdfd01b9aa7b4"
2467-
integrity sha512-wcYmSJOdvk6VAPx8IcmZgN08XTXRwRtB1aOLZm+MVHjIZIhHoBGZJYTVQS/BWjldsamj2cX3YGbGXNunaCfYJQ==
2468-
dependencies:
2469-
"@sentry/hub" "6.19.7"
2470-
"@sentry/types" "6.19.7"
2471-
tslib "^1.9.3"
2472-
2473-
"@sentry/nextjs@^6.19.7":
2474-
version "6.19.7"
2475-
resolved "https://registry.yarnpkg.com/@sentry/nextjs/-/nextjs-6.19.7.tgz#2c40692d89a99ec1382189f11702b1498c91fb77"
2476-
integrity sha512-029gpqhR6gHF7zfE9oxFOf3Zm68CShDu8/6azC8mwfIfJtyLC9dqztJJi48j0Uxs+sR1TEkN5Dw3wZbfWtFd8g==
2477-
dependencies:
2478-
"@sentry/core" "6.19.7"
2479-
"@sentry/hub" "6.19.7"
2480-
"@sentry/integrations" "6.19.7"
2481-
"@sentry/node" "6.19.7"
2482-
"@sentry/react" "6.19.7"
2483-
"@sentry/tracing" "6.19.7"
2484-
"@sentry/utils" "6.19.7"
2485-
"@sentry/webpack-plugin" "1.18.8"
2463+
"@sentry/nextjs@^7.0.0":
2464+
version "7.0.0"
2465+
resolved "https://registry.yarnpkg.com/@sentry/nextjs/-/nextjs-7.0.0.tgz#d9ea708028bc71b4b0b86a0141fee4c4887174a0"
2466+
integrity sha512-H0cV1rnippq3jBqnIF22wZLOaJzyPS/N2FrNxuvNLn+pY38mmtPF8kNpdTweDoM/RD7V7z+LuFE/uD8V75zZKQ==
2467+
dependencies:
2468+
"@sentry/core" "7.0.0"
2469+
"@sentry/hub" "7.0.0"
2470+
"@sentry/integrations" "7.0.0"
2471+
"@sentry/node" "7.0.0"
2472+
"@sentry/react" "7.0.0"
2473+
"@sentry/tracing" "7.0.0"
2474+
"@sentry/types" "7.0.0"
2475+
"@sentry/utils" "7.0.0"
2476+
"@sentry/webpack-plugin" "1.18.9"
24862477
tslib "^1.9.3"
24872478

2488-
"@sentry/node@6.19.7":
2489-
version "6.19.7"
2490-
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-6.19.7.tgz#32963b36b48daebbd559e6f13b1deb2415448592"
2491-
integrity sha512-gtmRC4dAXKODMpHXKfrkfvyBL3cI8y64vEi3fDD046uqYcrWdgoQsffuBbxMAizc6Ez1ia+f0Flue6p15Qaltg==
2479+
"@sentry/node@7.0.0":
2480+
version "7.0.0"
2481+
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.0.0.tgz#771169162b5ab021ea691f329a80aaf980d5b265"
2482+
integrity sha512-YfmPldRH2oO3OCsu5kqnzVbeMa2Tr9Qf4t8iy7AuYKPok5ossIeZCBzjTBRw/g0wJL+I5WsxHVrt2YUuLGYBSQ==
24922483
dependencies:
2493-
"@sentry/core" "6.19.7"
2494-
"@sentry/hub" "6.19.7"
2495-
"@sentry/types" "6.19.7"
2496-
"@sentry/utils" "6.19.7"
2484+
"@sentry/core" "7.0.0"
2485+
"@sentry/hub" "7.0.0"
2486+
"@sentry/types" "7.0.0"
2487+
"@sentry/utils" "7.0.0"
24972488
cookie "^0.4.1"
24982489
https-proxy-agent "^5.0.0"
24992490
lru_map "^0.3.3"
25002491
tslib "^1.9.3"
25012492

2502-
"@sentry/react@6.19.7", "@sentry/react@^6.19.7":
2503-
version "6.19.7"
2504-
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-6.19.7.tgz#58cc2d6da20f7d3b0df40638dfbbbc86c9c85caf"
2505-
integrity sha512-VzJeBg/v41jfxUYPkH2WYrKjWc4YiMLzDX0f4Zf6WkJ4v3IlDDSkX6DfmWekjTKBho6wiMkSNy2hJ1dHfGZ9jA==
2493+
"@sentry/react@7.0.0", "@sentry/react@^7.0.0":
2494+
version "7.0.0"
2495+
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.0.0.tgz#186a8cf7625b51372b8653450d6f73698d2a6425"
2496+
integrity sha512-zF/fUjyWXAjycS6WEv4BntKpp/CzHr7Qv0qB1n1EITvdMAYWfJTOhXdIKF/U9Rq/OmM0Gd8SthFWaEAJWzCgZQ==
25062497
dependencies:
2507-
"@sentry/browser" "6.19.7"
2508-
"@sentry/minimal" "6.19.7"
2509-
"@sentry/types" "6.19.7"
2510-
"@sentry/utils" "6.19.7"
2498+
"@sentry/browser" "7.0.0"
2499+
"@sentry/types" "7.0.0"
2500+
"@sentry/utils" "7.0.0"
25112501
hoist-non-react-statics "^3.3.2"
25122502
tslib "^1.9.3"
25132503

2514-
"@sentry/tracing@6.19.7", "@sentry/tracing@^6.19.7":
2515-
version "6.19.7"
2516-
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-6.19.7.tgz#54bb99ed5705931cd33caf71da347af769f02a4c"
2517-
integrity sha512-ol4TupNnv9Zd+bZei7B6Ygnr9N3Gp1PUrNI761QSlHtPC25xXC5ssSD3GMhBgyQrcvpuRcCFHVNNM97tN5cZiA==
2504+
"@sentry/tracing@7.0.0", "@sentry/tracing@^7.0.0":
2505+
version "7.0.0"
2506+
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.0.0.tgz#17e3fac487edef63fbe8b1bbfb202118952b2956"
2507+
integrity sha512-eUHER2RWzm9OtFKQZIr5EwTGM3IU0xJ7l60rnAEbgW5b1bzWC0k/J6EeXeBBfGq7wric/BjH0WKQOnixtXUBpw==
25182508
dependencies:
2519-
"@sentry/hub" "6.19.7"
2520-
"@sentry/minimal" "6.19.7"
2521-
"@sentry/types" "6.19.7"
2522-
"@sentry/utils" "6.19.7"
2509+
"@sentry/hub" "7.0.0"
2510+
"@sentry/types" "7.0.0"
2511+
"@sentry/utils" "7.0.0"
25232512
tslib "^1.9.3"
25242513

2525-
"@sentry/types@6.19.7":
2526-
version "6.19.7"
2527-
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-6.19.7.tgz#c6b337912e588083fc2896eb012526cf7cfec7c7"
2528-
integrity sha512-jH84pDYE+hHIbVnab3Hr+ZXr1v8QABfhx39KknxqKWr2l0oEItzepV0URvbEhB446lk/S/59230dlUUIBGsXbg==
2514+
"@sentry/types@7.0.0":
2515+
version "7.0.0"
2516+
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.0.0.tgz#a564b9762a8f5573ad17259093988da09be1db23"
2517+
integrity sha512-im6iugKKyeOwHWiS3u+S+Ox4F6aJQ2fe76rzTDTlzdCPol4xEqYnB2kujGVVnDYrODR+qVb24ua3OsxXxwzppA==
25292518

2530-
"@sentry/utils@6.19.7":
2531-
version "6.19.7"
2532-
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-6.19.7.tgz#6edd739f8185fd71afe49cbe351c1bbf5e7b7c79"
2533-
integrity sha512-z95ECmE3i9pbWoXQrD/7PgkBAzJYR+iXtPuTkpBjDKs86O3mT+PXOT3BAn79w2wkn7/i3vOGD2xVr1uiMl26dA==
2519+
"@sentry/utils@7.0.0":
2520+
version "7.0.0"
2521+
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.0.0.tgz#c83d0535f58457067a4156e5558223afd256b747"
2522+
integrity sha512-wmZNwzl1F/xCvaGX0TLz0+M+mZP8kn5woF770o2eUgXGURIuNsnSd0Vfi0nHuBJfngVeI/3+ofOJ9MH4Co4lIw==
25342523
dependencies:
2535-
"@sentry/types" "6.19.7"
2524+
"@sentry/types" "7.0.0"
25362525
tslib "^1.9.3"
25372526

2538-
"@sentry/webpack-plugin@1.18.8":
2539-
version "1.18.8"
2540-
resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.18.8.tgz#247a73a0aa9e28099a736bbe89ca0d35cbac7636"
2541-
integrity sha512-PtKr0NL62b5L3kPFGjwSNbIUwwcW5E5G6bQxAYZGpkgL1MFPnS4ND0SAsySuX0byQJRFFium5A19LpzyvQZSlQ==
2527+
"@sentry/webpack-plugin@1.18.9":
2528+
version "1.18.9"
2529+
resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-1.18.9.tgz#acb48c0f96fdb9e73f1e1db374ea31ded6d883a8"
2530+
integrity sha512-+TrenJrgFM0QTOwBnw0ZXWMvc0PiOebp6GN5EbGEx3JPCQqXOfXFzCaEjBtASKRgcNCL7zGly41S25YR6Hm+jw==
25422531
dependencies:
2543-
"@sentry/cli" "^1.73.0"
2532+
"@sentry/cli" "^1.74.4"
25442533

25452534
"@sideway/address@^4.1.3":
25462535
version "4.1.4"

0 commit comments

Comments
 (0)