Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore(docs): turn off sentry sends for local dev (#35852)

Charisb7c83df437d5
diff --git a/apps/docs/instrumentation-client.ts b/apps/docs/instrumentation-client.ts
index a6f56108fbb..a443f58c5ed 100644
--- a/apps/docs/instrumentation-client.ts
+++ b/apps/docs/instrumentation-client.ts
@@ -5,20 +5,20 @@
import * as Sentry from '@sentry/nextjs'
import { IS_DEV } from './lib/constants'
-Sentry.init({
- dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
+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,
+ // 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,
- // Error thrown if local infra is not running
- ...(IS_DEV ? ['Failed to fetch (localhost:8000)'] : []),
- ],
-})
+ 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,
+ ],
+ })
+}
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart
diff --git a/apps/docs/sentry.edge.config.ts b/apps/docs/sentry.edge.config.ts
index 85d68dc409b..1d08b9f874f 100644
--- a/apps/docs/sentry.edge.config.ts
+++ b/apps/docs/sentry.edge.config.ts
@@ -4,10 +4,13 @@
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from '@sentry/nextjs'
+import { IS_DEV } from './lib/constants'
-Sentry.init({
- dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
+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,
-})
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
+ debug: false,
+ })
+}
diff --git a/apps/docs/sentry.server.config.ts b/apps/docs/sentry.server.config.ts
index 0ff9859a7b4..b8764647d2c 100644
--- a/apps/docs/sentry.server.config.ts
+++ b/apps/docs/sentry.server.config.ts
@@ -3,10 +3,13 @@
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from '@sentry/nextjs'
+import { IS_DEV } from './lib/constants'
-Sentry.init({
- dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
+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,
-})
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
+ debug: false,
+ })
+}