2
0

💚 Fix sentry not sending events

This commit is contained in:
Baptiste Arnaud
2022-12-20 10:05:30 +01:00
parent 2bec6bda83
commit 054cbb3585
7 changed files with 231 additions and 200 deletions

View File

@ -8,23 +8,26 @@ const withTM = require('next-transpile-modules')([
])
/** @type {import('next').NextConfig} */
const nextConfig = {
const nextConfig = withTM({
reactStrictMode: true,
output: 'standalone',
experimental: {
outputFileTracingRoot: path.join(__dirname, '../../'),
},
sentry: {
hideSourceMaps: true,
},
}
})
const sentryWebpackPluginOptions = {
silent: true,
}
module.exports = withTM(
process.env.SENTRY_AUTH_TOKEN
? withSentryConfig(nextConfig, sentryWebpackPluginOptions)
: nextConfig
)
module.exports = process.env.NEXT_PUBLIC_SENTRY_DSN
? withSentryConfig(
{
...nextConfig,
sentry: {
hideSourceMaps: true,
},
},
sentryWebpackPluginOptions
)
: nextConfig

View File

@ -4,10 +4,8 @@
import * as Sentry from '@sentry/nextjs'
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN
Sentry.init({
dsn: SENTRY_DSN,
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
ignoreErrors: ['ResizeObserver loop limit exceeded'],
beforeBreadcrumb(breadcrumb, hint) {
try {

View File

@ -4,9 +4,7 @@
import * as Sentry from '@sentry/nextjs'
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN
Sentry.init({
dsn: SENTRY_DSN,
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
ignoreErrors: ['ResizeObserver loop limit exceeded'],
})