Skip to content

Commit 8cc3a11

Browse files
julianknutsenclaude
andcommitted
fix: import getDefaultIntegrations from @sentry/browser
@sentry/react doesn't re-export getDefaultIntegrations or globalHandlersIntegration, so the previous code silently called undefined. Import directly from @sentry/browser to ensure GlobalHandlers hooks window.onerror and onunhandledrejection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5e7b49b commit 8cc3a11

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

web/src/main.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import "./api/prefetch"; // Start browse fetch immediately, before React mounts.
2+
import { getDefaultIntegrations, globalHandlersIntegration } from "@sentry/browser";
23
import * as Sentry from "@sentry/react";
34
import { StrictMode } from "react";
45
import { createRoot } from "react-dom/client";
@@ -9,10 +10,12 @@ import "./styles/global.css";
910
Sentry.init({
1011
dsn: import.meta.env.VITE_SENTRY_DSN || "",
1112
environment: import.meta.env.VITE_ENVIRONMENT || "development",
12-
integrations: Sentry.getDefaultIntegrations({}).concat([
13+
integrations: [
14+
...getDefaultIntegrations({}),
15+
globalHandlersIntegration({ onerror: true, onunhandledrejection: true }),
1316
Sentry.browserTracingIntegration(),
1417
Sentry.replayIntegration(),
15-
]),
18+
],
1619
tracesSampleRate: 0.2,
1720
replaysSessionSampleRate: 0,
1821
replaysOnErrorSampleRate: 1.0,

0 commit comments

Comments
 (0)