Proper Approach to Determine if Replay Integration is Enabled? #8137
Unanswered
matthewborgman
asked this question in
Q&A
Replies: 1 comment
-
This should work! If it doesn't could you add Ideally there is only one call to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all.
We've recently integrated Sentry into a React-based SPA, Sanity Studio, but are having issues when switching "datasets" within the application. Specifically, "Error: Multiple Sentry Session Replay instances are not supported" which then crashes the application.
Sentry is integrated through one of Sanity's customization points, which allows us to wrap a top-level, but not the top-level, component:
What would be the best way to determine if the Session Replay integration is already enabled so as to avoid this error? Getting the hub and client, post
init
, and then checking for an integration and conditionally adding doesn't seem to work either:Alternatively, we considered wrapping
Sentry.init
inuseEffect(() => {}, [])
plus a cleanup function, but aren't sure what we'd call to "uninitialize" things. #7464 (comment) specifically says not to callSentry.close
followed bySentry.init
again.Any help is much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions