-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Sentry packages to v8 #6387
Changes from all commits
3bdfd86
afa09d2
593298e
7351b3d
14c4d4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export async function register() { | ||
if (process.env.NEXT_RUNTIME === 'nodejs') { | ||
await import('./sentry.server.config') | ||
} | ||
|
||
if (process.env.NEXT_RUNTIME === 'edge') { | ||
await import('./sentry.edge.config') | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ const nextConfig = { | |
|
||
experimental: { | ||
forceSwcTransforms: true, | ||
instrumentationHook: true, | ||
optimizePackageImports: ['@zooniverse/react-components', 'grommet', 'grommet-icons'] | ||
}, | ||
|
||
|
@@ -96,10 +97,6 @@ const nextConfig = { | |
] | ||
}, | ||
|
||
sentry: { | ||
hideSourceMaps: true | ||
}, | ||
|
||
webpack: (config, options) => { | ||
config.resolve = { | ||
...config.resolve, | ||
|
@@ -119,7 +116,12 @@ const nextConfig = { | |
module.exports = million.next( | ||
withSentryConfig(nextConfig, { | ||
org: 'zooniverse-27', | ||
project: 'fem-app-project' | ||
project: 'fem-app-project', | ||
sourcemaps: { | ||
disable: true, | ||
}, | ||
telemetry: false, | ||
authToken: process.env.SENTRY_AUTH_TOKEN | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this was not required previously, but is with these changes, it looks like per https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#extend-your-nextjs-configuration . |
||
}), | ||
{ | ||
auto: true | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ if (process.env.NEWRELIC_LICENSE_KEY) { | |
require('newrelic') | ||
} | ||
|
||
const Sentry = require('@sentry/nextjs') | ||
const express = require('express') | ||
const next = require('next') | ||
|
||
|
@@ -26,15 +25,12 @@ const handle = app.getRequestHandler() | |
|
||
app.prepare().then(() => { | ||
const server = express() | ||
|
||
server.use(Sentry.Handlers.requestHandler()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sentry.Handlers isn't needed anymore |
||
setLogging(server) | ||
|
||
server.get('*', (req, res) => { | ||
return handle(req, res) | ||
}) | ||
|
||
server.use(Sentry.Handlers.errorHandler()) | ||
server.use(function onError(error, req, res, next) { | ||
res.statusCode = 500 | ||
res.end(res.sentry + "\n") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://nextjs.org/docs/app/api-reference/file-conventions/instrumentation