-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
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/react
SDK Version
7.109.0
Framework Version
18.2.0
Link to Sentry event
SDK Setup
Sentry.init({
dsn: import.meta.env.PROD ? SENTRY_DSN : '',
environment: import.meta.env.VITE_VERCEL_ENV,
normalizeDepth: 10,
integrations: [Sentry.replayIntegration({ maskAllText: false, networkDetailAllowUrls: [API_URL] }), Sentry.metrics.metricsAggregatorIntegration()],
replaysSessionSampleRate: 1.0,
replaysOnErrorSampleRate: 1.0,
});The metrics integration has been recently added. This error has been occurring from before it was added.
Steps to Reproduce
- Init Sentry as shown above
- Observe the TypeError appearing in Sentry
Not sure what the specific trigger is
Expected Result
No such TypeErrors occurring
Actual Result
TypeError: Cannot read properties of undefined (reading 'replace')
This is an error that is triggered internally by Sentry Tracing, according to the stack trace. It happens in @sentry-internal/tracing/esm/browser/web-vitals/lib/initMetric.js on line 30:
if (navEntry) {
if (WINDOW.document.prerendering || getActivationStart() > 0) {
navigationType = 'prerender';
} else {
navigationType = navEntry.type.replace(/_/g, '-') ;
}
}I'm not using the Tracing integration, but I notice the Replay integration calls some functionally of it (initMetric('LCP');).
Metadata
Metadata
Assignees
Labels
Projects
Status
No status
Status
Waiting for: Community