Sentry multiple instances (Sentry.init) in complex React App

Hello.

In the App I have Sentry initialization implemented according documentation:

Sentry.init( {
    dsn: "very_secret",
    integrations: [new Integrations.BrowserTracing()],
    tracesSampleRate: 1.0,
} );

...

<App>
...
    <Widget />
</App>

The Widget is a component from another package and it has the self implementation of Sentry integration with the self Sentry project:

Sentry.init( {
    dsn: "very_secret",
    integrations: [new Integrations.BrowserTracing()],
    tracesSampleRate: 1.0,
} );

...

<Sentry.ErrorBoundary fallback={"An error has occurred"}>
...
</Sentry.ErrorBoundary>

Eventually, in the bundle.js we have two “Sentry.init” calls.

As a result, when the application running and an error generated inside the Widget component, the application sends 2 the same events in the Sentry Application project only (!), i.e. the Sentry Widget project related to the Widget component does not receive an error event!

Is it possible in this case using with any settings to provide send only 1 event to the Sentry Widget project (because of the error generated inside the Widget component)?

2 Likes

I have the same problem. Have you solve this

Is there any update on this topic?