Skip to content

Commit

Permalink
Merge pull request #2183 from City-of-Helsinki/hotfix-next12
Browse files Browse the repository at this point in the history
Fix Next12 builds part 1/x - Remove TS things  from JS config file
  • Loading branch information
sirtawast authored Aug 22, 2023
2 parents 15481ef + 1dfe2e6 commit 002d87a
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions frontend/shared/sentry-config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
import * as Sentry from "@sentry/nextjs";
import * as Sentry from '@sentry/nextjs';
import maskGDPRData from 'shared/utils/mask-gdpr-data';

export default function sentryConfig() {
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN || '',
environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT || 'development',
attachStacktrace: true,
maxBreadcrumbs: Number(process.env.NEXT_PUBLIC_SENTRY_MAX_BREADCRUMBS) || 100,
// Adjust this value in production, or use tracesSampler for greater control
// @see https://develop.sentry.dev/sdk/performance/
tracesSampleRate: 1,
beforeBreadcrumb(breadcrumb: Sentry.Breadcrumb) {
return {
...breadcrumb,
message: maskGDPRData(breadcrumb.message),
data: maskGDPRData(breadcrumb.data),
};
},
beforeSend(event: Sentry.Event) {
return maskGDPRData(event);
},
})
};
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN || '',
environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT || 'development',
attachStacktrace: true,
maxBreadcrumbs:
Number(process.env.NEXT_PUBLIC_SENTRY_MAX_BREADCRUMBS) || 100,
// Adjust this value in production, or use tracesSampler for greater control
// @see https://develop.sentry.dev/sdk/performance/
tracesSampleRate: 1,
beforeBreadcrumb(breadcrumb) {
return {
...breadcrumb,
message: maskGDPRData(breadcrumb.message),
data: maskGDPRData(breadcrumb.data),
};
},
beforeSend(event) {
return maskGDPRData(event);
},
});
}

0 comments on commit 002d87a

Please sign in to comment.