Skip to content

Commit

Permalink
Adapt sentry configuration following the package update
Browse files Browse the repository at this point in the history
  • Loading branch information
dtrucs committed Oct 8, 2024
1 parent 14ae17c commit 3ee5984
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
16 changes: 10 additions & 6 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ const plugins = [
[withPWA],
[withSourceMaps()],
[withBundleAnalyzer],
nextConfig => withSentryConfig(nextConfig, { silent: true }),
nextConfig =>
withSentryConfig(nextConfig, {
hideSourceMaps: true,
disableServerWebpackPlugin: true,
disableClientWebpackPlugin: true,
silent: true,
}),
];

const nextConfig = {
Expand All @@ -53,11 +59,6 @@ const nextConfig = {
locales: mergedHeaderConfig.menu.supportedLanguages,
defaultLocale: mergedHeaderConfig.menu.defaultLanguage,
},
sentry: {
hideSourceMaps: true,
disableServerWebpackPlugin: true, //process.env.SENTRY_DSN === undefined,
disableClientWebpackPlugin: true, //process.env.SENTRY_DSN === undefined,
},
publicRuntimeConfig: getAllConfigs,
images: {
remotePatterns: [
Expand All @@ -66,6 +67,9 @@ const nextConfig = {
},
],
},
experimental: {
instrumentationHook: true,
},
};

module.exports = async (phase, { defaultConfig }) =>
Expand Down
7 changes: 7 additions & 0 deletions frontend/src/instrumentation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as Sentry from '@sentry/nextjs';

export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
await import('./sentry.server.config');
}
}
1 change: 1 addition & 0 deletions frontend/src/sentry.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const sentryOptions = {
environment: process.env.ENVIRONMENT,
maxBreadcrumbs: 50,
attachStacktrace: true,
integrations: [Sentry.replayIntegration()],
};

// Development & tests setup
Expand Down

0 comments on commit 3ee5984

Please sign in to comment.