-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(browser): Warn on duplicate browserTracingIntegration
#16042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
size-limit report 📦
|
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/1337', | ||
integrations: [Sentry.browserTracingIntegration(), Sentry.browserTracingIntegration()], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just hit a problem where I had Sentry.reactRouterV7BrowserTracingIntegration
alongside Sentry.browserTracingIntegration
, and after some search I found your comment here that unblocked me (thank you!)
It would be nice if the warning would be shown when 2 conflicting tracing integrations are loaded at Sentry.init
time, but I understand it might be difficult to implement.
Maybe, an alternative would be to emphasis on this exclusivity in both the code (https://github.com/getsentry/sentry-javascript/blob/develop/packages/react-router/src/client/tracingIntegration.ts) and in the official sentry docs as well (https://docs.sentry.io/platforms/javascript/guides/react/features/react-router/v7/#usage-with-useroutes-hook)?
Suggestion in the docs:
If you specify your route definitions as an object to the
useRoutes
hook, replace yourSentry.browserTracingIntegration
toSentry.reactRouterV7BrowserTracingIntegration
inside Sentry.init
Closes #16040
this logs a warning if a user adds multiple instances of
browserTracingIntegration
. If this is done, this can lead to potentially weird things (e.g. we add multiple handlers etc).This is especially relevant for react, as there are multiple different integrations there that users may add.