-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Cannot convert undefined or null to object
in Chrome v74
#3388
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
This is indicated as the error coming from the Sentry, as we are wrapping The error is produced when calling the original This error is usually produced by Hope that helps to dig into the issue more. Cheers! |
@kamilogorek Hi bro, does this issue is same as #2074 ? I saw @martinsaposnic use And @NateScarlet reference a link which provide a solution, is it appropriate ?
|
Yes, this would be correct: const isAffectByIssue3388 = navigator.userAgent.includes('Chrome/74.0.3729')
Sentry.init({
integrations: [new Sentry.Integrations.TryCatch({
requestAnimationFrame: !isAffectByIssue3388,
})]
}); |
Tks bro. I use this, should have better compatibility, no need rewrite all default integrations const isAffectByIssue3388 = navigator.userAgent.includes('Chrome/74.0.3729')
Sentry.init({
integrations: function(integrations) {
const newIntegrations = integrations.map((integration) => {
if (integration.name === 'TryCatch') {
return new Sentry.Integrations.TryCatch({
requestAnimationFrame: !isAffectByIssue3388 // disable raf hook
})
}
return integration
})
return newIntegrations
}
}) |
It won't rewrite them. We are doing a smart-merge, so only |
Oh ok, thanks for providing this info |
event target wrap is also affected, is this same as #2074 ? |
Every instrumentation that eventually calls native function can be reported like this. It's very rare occurrence, but it can happen. |
We have the same issues. However, not everyone uses chrome 74.0.3729. Some android app (like Facebook) is using their own Facebook user-agent, but the underlying browser is system webview, which may be chrome 74. We can't fully apply workaround for these users by detecting user-agent. Hope this can be fixed. |
We're also seeing this. Are there plans to implement the proposed workaround in Sentry SDK or does everybody need to copy&paste the fix from here? |
@Fonger hello, How did you finally solve it? |
Sadly we didn't solve it. I just apply the Chrome 74 user-agent workaround and ignore the minority of the affected users. |
ok, thanks. |
…on (#4695) Users have reported running into a bug in Chrome wherein calling `addEventListener` or `requestAnimationFrame` too many times on `window` eventually throws an error when our `try-catch` integration is running, specifically because of how we wrap those functions. In the discussion of that bug, [one user](#2074 (comment)) reported that replacing our `call` call with an `apply` call in our wrapping functions solved the problem for him. This makes that change, in the hopes it will fix the problem for everyone. Fixes #3388 Fixes #2074
https://sentry.io/organizations/the-dotcom-u0/issues/2334549076/?project=1880120&query=is%3Aunresolved
Package + Version
@sentry/browser
Version:
Description
Happening in Chrome version 74.0.3729.0
Getting this error:
Cannot convert undefined or null to object
It seems that this issue should be reopened #2074 and this PR #3208 doesn't solve this issue
The text was updated successfully, but these errors were encountered: