Internal Sentry Error: r._mergeOptions is not a function
See original GitHub issue- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
-
@sentry/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:
Version:
5.15.5
Description
This error is related to another issue: https://github.com/getsentry/sentry-javascript/issues/2541
As per the Advance Usage docs, I am trying to manage several instances of Sentry. I am developing a widget and would like to use Sentry without it conflicting with the host page.
Based on the documentation and suggestions from this thread, I am achieving this using a new Hub
instance, and calling the run
method inside the widget.
My (simplified) code looks like:
const client = new BrowserClient({
dsn: process.env.SENTRY_DSN,
integrations: [
new Sentry.Integrations.InboundFilters(),
new Sentry.Integrations.UserAgent(),
new Sentry.Integrations.Breadcrumbs()
]
});
const hub = new Hub(client);
// Based on https://github.com/getsentry/sentry-javascript/issues/2541
hub.bindClient(client);
...
hub.run((currentHub) => {
currentHub.captureException(error);
});
For host pages without Sentry, everything works well. However, on host pages where Sentry is already being used, internal Sentry exceptions are being thrown from each Sentry package. This line breaks with the message r._mergeOptions is not a function
.
This error will appear in both Sentry projects. It appears that somehow they might be breaking each other, and logging the exception. Integrations do not work in these exceptions, I assume because it’s the integrations that are breaking.
There are still other exceptions that are logged correctly by both projects, so it’s unclear when or how this situation arises. It’s also unclear if this error is gobbling other exceptions.
This is a major use-case for our organization. Hoping for a fix or suggestion so that we can resolve quickly (for now we need to turn Sentry off).
Links to the issue:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:29 (6 by maintainers)
Top GitHub Comments
I’m running into this error with my app. My app is a 3rd party app loaded by pages that I don’t control so my guess is that some of these pages are loading Sentry as well. I am already using a version that includes @kamilogorek fix above however most of my sentry error reports seem to be this problem related to
_mergeOptions
. Is there a recommendation on how to deal with this?Couple of follow up questions: When this error happens does this prevent sentry from reporting additional errors? Should I just filter out this error using the
Inbound Filters
in Sentry?I managed to resolve my issue above. I ended up having multiple calls to
Sentry.init(...)
in the same page load. After I removed the duplicate call, everything worked as expected.