From d9fcfc955b01a0ef9d894fa53c3911ab3b4375c8 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Tue, 24 Mar 2026 16:04:05 +0800 Subject: [PATCH] order --- web/instrumentation-client.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/web/instrumentation-client.ts b/web/instrumentation-client.ts index 502b39e8be..459b2357fb 100644 --- a/web/instrumentation-client.ts +++ b/web/instrumentation-client.ts @@ -2,22 +2,6 @@ import { IS_DEV } from '@/config' import { env } from '@/env' async function main() { - const SENTRY_DSN = env.NEXT_PUBLIC_SENTRY_DSN - - if (!IS_DEV && SENTRY_DSN) { - const Sentry = await import('@sentry/react') - Sentry.init({ - dsn: SENTRY_DSN, - integrations: [ - Sentry.browserTracingIntegration(), - Sentry.replayIntegration(), - ], - tracesSampleRate: 0.1, - replaysSessionSampleRate: 0.1, - replaysOnErrorSampleRate: 1.0, - }) - } - // Polyfill for Array.prototype.toSpliced (ES2023, Chrome 110+) if (!Array.prototype.toSpliced) { // eslint-disable-next-line no-extend-native @@ -76,6 +60,22 @@ async function main() { value: sessionStorage, }) } + + const SENTRY_DSN = env.NEXT_PUBLIC_SENTRY_DSN + + if (!IS_DEV && SENTRY_DSN) { + const Sentry = await import('@sentry/react') + Sentry.init({ + dsn: SENTRY_DSN, + integrations: [ + Sentry.browserTracingIntegration(), + Sentry.replayIntegration(), + ], + tracesSampleRate: 0.1, + replaysSessionSampleRate: 0.1, + replaysOnErrorSampleRate: 1.0, + }) + } } main()