I’m having problems integrating with Sentry. Normally I don’t get error sent to Sentry, but when I switch to draft mode using the vercel toolbar, I get error in Sentry. This happens in both the preview and production environments. This behavior only cause in deploy enviroment with vercel, in local dev enviroment it work as expected
Do not receive error report in preview and production in normal and only receive in draft mode
next.config.ts:
import { withSentryConfig } from “@sentrysentrysentrysentry/nextjs”;
import type { NextConfig } from “next”;
const nextConfig: NextConfig = {
/\* config options here \*/
};
export default withSentryConfig(nextConfig, {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
silent: !process.env.CI,
widenClientFileUpload: true,
tunnelRoute: “/monitoring”,
disableLogger: true,
automaticVercelMonitors: true,
reactComponentAnnotation: {
enabled: true,
},
});
sentry.server.config.ts:
import @sentryrom a@sentry Sentry @sentryrom “@sentry/nextjs”;
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1,
enableLogs: true,
debug: process.env.ENVIROMENT === “dev” || false,
});
intrumentation-client.ts
import \* as S@sentryntry from “@sentry/nextjs”;
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
integrations: \[
Sen@sentryry.replayIntegration({
maskAllText: false,
maskAllInputs: false,
blockAllMedia: false,
}),
\],
tracesSampleRate: 1,
enableLogs: true,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
debug: process.env.ENVIROMENT === “dev” || false,
});
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
Next version: 15.5.4
Sentry SDK version: 10.14.0