Skip to content

Commit

Permalink
fix: Sentry v7 to v8 migration issues (#317)
Browse files Browse the repository at this point in the history
* fix: Sentry v7 to v8 migration issues
* Fix deprecated document meta tag
  • Loading branch information
jmrossy authored Nov 8, 2024
1 parent 6b05b45 commit b8f74d2
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
1 change: 0 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ const nextConfig = {
},

reactStrictMode: true,
swcMinify: true,
}

const sentryOptions = {
Expand Down
10 changes: 5 additions & 5 deletions sentry.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ if (process.env.NEXT_PUBLIC_SENTRY_DSN) {
Sentry.init({
...sentryDefaultConfig,
integrations: [
new Sentry.Integrations.Breadcrumbs({
Sentry.breadcrumbsIntegration({
console: false,
dom: false,
fetch: false,
history: false,
sentry: false,
xhr: false,
}),
new Sentry.Integrations.Dedupe(),
new Sentry.Integrations.FunctionToString(),
new Sentry.Integrations.GlobalHandlers(),
new Sentry.Integrations.HttpContext(),
Sentry.dedupeIntegration(),
Sentry.functionToStringIntegration(),
Sentry.globalHandlersIntegration(),
Sentry.httpContextIntegration(),
],
});
}
2 changes: 2 additions & 0 deletions sentry.default.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const filters = [
"canvas.contentDocument",
"MyApp_RemoveAllHighlights",
"atomicFindClose",
"Wallet is not initialized",
"region has been blocked from accessing this service"
]

export const sentryDefaultConfig = {
Expand Down
6 changes: 0 additions & 6 deletions sentry.edge.config.js

This file was deleted.

6 changes: 0 additions & 6 deletions sentry.server.config.js

This file was deleted.

13 changes: 13 additions & 0 deletions src/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as Sentry from '@sentry/nextjs';
import { sentryDefaultConfig } from '../sentry.default.config';

export function register() {
if (process.env.NEXT_PUBLIC_SENTRY_DSN) {
if (process.env.NEXT_RUNTIME === 'nodejs') {
Sentry.init({ ...sentryDefaultConfig, defaultIntegrations: false });
}
if (process.env.NEXT_RUNTIME === 'edge') {
Sentry.init({ ...sentryDefaultConfig, defaultIntegrations: false });
}
}
}
2 changes: 1 addition & 1 deletion src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function Document() {

<meta name="HandheldFriendly" content="true" />
<meta name="apple-mobile-web-app-title" content={APP_NAME} />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />

<meta property="og:url" content={APP_URL} />
<meta property="og:title" content={APP_NAME} />
Expand Down

0 comments on commit b8f74d2

Please sign in to comment.