-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Closed
Copy link
Labels
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
8.42.0
Framework Version
"next": "15.0.4"
Link to Sentry event
https://bizforward.sentry.io/issues/6155743438/events/a1389f97618147fa890ed7ec864d39ca/
Reproduction Example/SDK Setup
import * as Sentry from '@sentry/nextjs';
const SENTRY_ENABLED = process.env.NEXT_PUBLIC_SENTRY_ENABLED === 'true';
const SENTRY_DEBUG = process.env.NEXT_PUBLIC_SENTRY_DEBUG === 'true';
console.log({ SENTRY_ENABLED, SENTRY_DEBUG });
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
environment: process.env.NEXT_PUBLIC_APP_ENV,
sampleRate: 1,
tracesSampleRate: 1,
replaysSessionSampleRate: 1,
replaysOnErrorSampleRate: 1,
normalizeDepth: 10,
tracePropagationTargets: [/^\//, '/api/graphql'],
// https://docs.sentry.io/platforms/javascript/configuration/integrations/#modifying-default-integrations
defaultIntegrations: false,
integrations: [
// default
Sentry.breadcrumbsIntegration(),
Sentry.browserApiErrorsIntegration(),
// Sentry.dedupeIntegration(), // disabled
Sentry.functionToStringIntegration(),
Sentry.globalHandlersIntegration(),
Sentry.httpContextIntegration(),
Sentry.inboundFiltersIntegration(),
Sentry.linkedErrorsIntegration(),
// trace
Sentry.browserTracingIntegration(),
// replay
Sentry.replayIntegration({
maskAllText: false,
blockAllMedia: true,
networkDetailAllowUrls: ['/api/graphql'],
networkCaptureBodies: true,
}),
],
debug: SENTRY_DEBUG,
release: process.env.NEXT_PUBLIC_SENTRY_RELEASE,
enabled: SENTRY_ENABLED,
beforeSend(event, hint) {
const errorType = event.exception?.values?.[0]?.type ?? '';
const errorMessage = event.exception?.values?.[0]?.value ?? '';
const normalizedMessage = errorMessage.replace(/\d/g, '*');
// https://docs.sentry.io/platforms/javascript/guides/node/enriching-events/fingerprinting/#group-errors-with-greater-granularity
event.fingerprint = ['{{ default }}', errorType, normalizedMessage];
return event;
},
});Steps to Reproduce
- Write code in your application to throw an Error inside useEffect as follows.
useEffect(() => {
throw new Error('useEffect!!!!!');
}, []);-
Start the application in development mode by
next dev, and confirm that an error occurs in the relevant code and that an Issue is created in Sentry. -
Create the production build by
next build, and start the application in production mode bynext start, and confirm that an error occurs in the relevant code but that an Issue is not created in Sentry.
Expected Result
In Next.js production mode, Error should be sent to Sentry.
Actual Result
In Next.js production mode, error is not sent to Sentry.
Lms24
Metadata
Metadata
Assignees
Labels
Projects
Status
Waiting for: Product Owner