Files
supabase/apps/docs/instrumentation-client.ts
T

36 lines
1.1 KiB
TypeScript

// This file configures the initialization of Sentry on the client.
// The added config here will be used whenever a users loads a page in their browser.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from '@sentry/nextjs'
import { IS_DEV } from './lib/constants'
if (!IS_DEV) {
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
ignoreErrors: [
// [Charis 2025-05-05]
// We should fix hydration problems but let's not make this a blocker for
// now.
/(?:text content does not match)|hydration|hydrating/i,
],
beforeSend(event) {
const frames = event.exception?.values?.[0].stacktrace?.frames || []
// Drop errors originating from user apps or extensions as unactionable
if (frames.some((frame) => frame.filename && frame.filename.startsWith('app:///'))) {
return null
}
return event
},
})
}
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart