-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Internal Sentry Error: r._mergeOptions is not a function #2622
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
Comments
Hey, I spent some time today trying to reproduce this issue, but I was not able to break it to get this exact error in any way. Is there a chance that you could provide some more info how to reproduce this? |
We were only getting these errors in production, hard to say why. I have a suspicion that it occurs when another (unrelated) exception is thrown. Have you tried throwing other exceptions? When I have some time I can try spinning up and dummy project and reproducing as well. |
I have the same issue
|
I tried every random idea to break it and I wasn't able to. Gibberish code below, don't analyze it. import * as Sentry from "@sentry/browser";
import { Hub, BrowserClient, defaultIntegrations } from "@sentry/browser";
Sentry.init({
dsn: "http://[email protected]/123"
});
const client = new BrowserClient({
dsn: "http://[email protected]/123",
integrations: defaultIntegrations
});
const client2 = new BrowserClient({
dsn: "http://[email protected]/123"
});
const hub = new Hub(client);
const hub2 = new Hub(client2);
const message = "wat";
const error = new Error("as");
setTimeout(() => {
throw new Error("wat");
Sentry.captureException(new Error("wat"));
Sentry.captureMessage("ok");
});
Sentry.captureException(new Error("wat"));
Sentry.captureMessage("ok");
hub.captureException(error);
hub.run(currentHub => {
currentHub.captureException(error);
Sentry.captureException(new Error("wat"));
Sentry.captureMessage("ok");
currentHub.configureScope(scope => {
currentHub.captureException(error);
if (message) {
scope.setTag("message", message);
}
currentHub.captureException(error);
setTimeout(() => {
throw new Error("wat");
});
Sentry.captureException(new Error("wat"));
Sentry.captureMessage("ok");
});
setTimeout(() => {
throw new Error("wat");
});
hub.run(currentHub => {
Sentry.captureException(new Error("wat"));
Sentry.captureMessage("ok");
currentHub.captureException(error);
currentHub.configureScope(scope => {
currentHub.captureException(error);
if (message) {
scope.setTag("message", message);
}
currentHub.captureException(error);
setTimeout(() => {
throw new Error("wat");
});
});
setTimeout(() => {
throw new Error("wat");
});
});
hub2.run(currentHub => {
currentHub.captureException(error);
currentHub.configureScope(scope => {
currentHub.captureException(error);
if (message) {
scope.setTag("message", message);
}
currentHub.captureException(error);
setTimeout(() => {
throw new Error("wat");
});
});
setTimeout(() => {
throw new Error("wat");
});
});
});
hub2.run(currentHub => {
currentHub.captureException(error);
currentHub.configureScope(scope => {
currentHub.captureException(error);
if (message) {
scope.setTag("message", message);
}
currentHub.captureException(error);
setTimeout(() => {
throw new Error("wat");
});
});
}); Unfortunately, it's very hard to even start debugging when I'm not able to break it. |
I think I am seeing this same issue I have added following snippet to our html page:
this issue does not happen in each request, so this might be browser related (some users using old browsers). |
@NicHaley have you resolved for your organization? We're hitting the same. |
@jackric We have not unfortunately. We have had to abandon this use-case for now. |
Hi, we have the issue on our live site at present, has anyone looked into the issue more? |
Hey, I've been trying to add Sentry to a React application according to the instructions, and still get this self._mergeOptions / e.wt is not a function logged instead. Any ideas? |
I am also seeing this when attempting to integrate with Vue.js. Vue version: import Vue from 'vue'
import * as Sentry from '@sentry/browser'
import { Vue as VueIntegration } from '@sentry/integrations'
Sentry.init({
dsn: '<redacted>',
release: '<redacted>',
environment: 'local',
integrations: [new VueIntegration({ Vue, attachProps: true, logErrors: true })],
}) Full stack trace:
|
We also have the same problem on our site: Vue version: import Vue from 'vue';
import * as Sentry from "@sentry/browser";
import { Vue as VueIntegration } from '@sentry/integrations';
I figure out that sometimes on reported bug in sentry we have two events with the same timestamp, one with correct entry:
and second with this bug:
|
I managed to resolve my issue above. I ended up having multiple calls to |
As for me, the issue was gone once I unchecked the "Disable cache" button in the developer tools. The interesting fact is that with that checkbox on I randomly received one of the following outcomes:
It feels like there was a race condition while loading sourcemaps or something. |
Still randomly having these errors. I'm wondering how https://browser.sentry-cdn.com/5.20.1/bundle.min.js even got into stacktrace? It doesn't get loaded and I'm using the latest version of the package. |
I resolved my issue - my code (with Sentry client) was loading onto a page that had another app loaded using Sentry. const client = new Sentry.BrowserClient({
dsn,
integrations: Sentry.defaultIntegrations,
environment: IS_LOCALHOST ? "localhost" : "prod",
release: RELEASE_STRING
});
const sentry = new Hub(client);
sentry.configureScope(scope => scope.setTag("userAgent", window.navigator.userAgent));
export const sentryErrorHandler = (error: Error, componentStack?: string) => {
console.log("Sentry captured error", error);
sentry.run(currentHub => {
currentHub.captureException(error);
});
}; I import and use this custom |
Seeing a spike of these errors today.
|
@some1else are 2 Sentry instances running on the page? From my experience either a 2nd Sentry instance was added or you had 2 already and now a new error in the app is tripping this bug. See my comment above for a workaround. |
To sum it up, yes, I also had two Sentry instances on the page. In my case, Sentry integration was also added via Google Tag Manager, and it added Sentry script from CDN. When I removed local Sentry and started using the one from GTM, these errors were gone. Hope, some day we will have a more comprehensive error message. |
I'd still love to fix this issue, but no matter what I try, I cannot reproduce this locally in any way. If someone is able to provide repro, I'll definitely take care of it. |
For me, it was happening when using |
Conflict between React integration and Tag Manager inserted CDN version here as well. |
@carlos-algms true, it was done in March. 2019 😅 But still, it should be contained within the class itself, so references should still work correctly. |
@kamilogorek It is way more complex than just references. |
That is correct, it'll go through the global hub first, but it was very hard to believe for me that it could still clash somehow, as these versions are so far apart. Good to know that some 3rd party plugins are still using such an old version though. So a tl;dr for anyone reading this thread as of now is: make sure that you are not running 2 separate instances of Sentry SDK (unless you are using client directly), and if you do, verify that both SDKs are running at least 5.0.0 release. |
In our case, it was caused by the fact that our client was using Sentry on his site, while we were using Sentry in our bundle (our customers have to include a code snippet to their site like you would do go google analytics). And because the customer's version has had the InboundFilters integration and our did not, it threw an error. We had to add the InboundFilter to our own Sentry instance integration to fix this. |
We are getting the We have a
On the page using Vue.js (v. 2.6.11), in the main.js:
Is there a way to add Vue integration to the Sentry init in base.html header? |
Tbh I'm not sure why you are trying to use lazy-loaded SDK, but then call |
@kamilogorek Vue is being used as a component on a subset of pages for the overall site. Most of the site is a static & RESTful with a bit of jQuery for DOM manipulation. The The pages with Vue look something like this: <base.html (with sentry js loaded in header)> <vue used to manage a dynamic table, with @sentry/vue> |
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 Couple of follow up questions: |
I'm getting this issue on React. I'm just following the basic directions at Sentry React docs here https://docs.sentry.io/platforms/javascript/guides/react. Is there anyone would faced it at React? It's getting hard to sort this out. |
Same issue here, trying to run a React application with Sentry, inside a Cordova shell also with Sentry. This is a real blocker, since one of the reasons we went with Sentry was the number of platforms supported - and since our app runs both on browsers and "native" (through Cordova), we can't really choose one or the other. @kamilogorek, I wonder if you saw the comment from I'm running Sentry React 7.38.0 and Sentry Cordova 1.0.4 (should I report it to these other repos instead? Not sure how similar is Cordova's with the base JS SDK). |
cc @getsentry/team-web-sdk-frontend |
@kamilogorek sorry to bother you again, but is there any person we could bring in? Should I try a support ticket instead? Open a new issue? Thanks for any guidance! |
You need to make sure all your Sentry dependencies have matched versions. If you grep for "sentry" in your lockfile and share it here I can tell you what version to pin your deps to. |
Actually, just make sure your sentry dependencies align with the dependencies defined in the cordova sdk:
|
Aha! THAT makes sense now! I was confused since EDIT - doesn't seem to solve the issue. See linked issue below. |
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)Version:
Description
This error is related to another issue: #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 therun
method inside the widget.My (simplified) code looks like:
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:
The text was updated successfully, but these errors were encountered: