You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@sentry/browser not working in chrome extensions #5289
When tackling this issue we should set up an example chrome extension to properly test our fix.
I think it also might be a good idea to rethink how we make use of getGlobalObject() in the SDK. Right now it basically acts as a type cast and is very error-prone.
I'm getting a similar error (Cannot read properties of undefined (reading 'email')) originating from chrome-extension://dbilanlcioamaadkbepcenpombaejbla/dist/inject_content.js but I've got a normal app, not a Chrome extension.
Hello there :)
Me and my team are developing a manifest V3 extension and I cant explain how much sentry has helped us so far!
We wanted to take our monitoring to the next level with sentry tracing, however we encourted the same thing as described in this issue. After some playing around we managed to bypass the current usage of WINDOW.document.visibilityState like this:
// Run this code before Sentry.init(...)Sentry.WINDOW.document={visibilityState: 'hidden',addEventListener: ()=>{},};
Ofcourse this isn't a long term solution and we will update as soon as this issue is closed 😄
BTW, if there are other people arriving on this thread while trying to add tracing to their manifest V3 extension make sure that you create a new transaction around the code that you need to be traced. It took us quite some time to understand that there is no transaction like pageload or something similar in extensions (This is my speculation after debugging for quite some time, in case I am mistaken please correct me 😄).
chrome.alarms.onAlarm.addListener(async(alarm: Alarm)=>{// Generic Sentry.init(....)setupSentry();consttransaction=Sentry.startTransaction({name: `Alarm ${alarm.name} rang`});Sentry.getCurrentHub().configureScope((scope)=>scope.setSpan(transaction));// Do your thing// ....transaction.finish();}
Hope this helps :)
Reacted by Vadorequest, Luca Forstner, Rony Fragin, gilmeir-arnac, spookyuser, Denys Ivanchuk, Piyush, Andrej Gajdos, Liren Tu, Carlos Ortiz and 3 more
Reacted by spookyuser, Piyush, Andrej Gajdos, Gideon Lapshun, rieg-ec, Carlos Ortiz , Lukas Vanagas and Gregor
I'm getting a similar error (Cannot read properties of undefined (reading 'email')) originating from chrome-extension://dbilanlcioamaadkbepcenpombaejbla/dist/inject_content.js but I've got a normal app, not a Chrome extension.
Is ur issue resolved now??
As I am also getting the same error.
Reacted by Louis Gualtero, Lee Han Ul and Yuri Mikhin
I'm getting a similar error (Cannot read properties of undefined (reading 'email')) originating from chrome-extension://dbilanlcioamaadkbepcenpombaejbla/dist/inject_content.js but I've got a normal app, not a Chrome extension.
I'm also getting this error.
Reacted by Louis Gualtero, Lee Han Ul and Yuri Mikhin
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Activity
lforst commentedon Jun 21, 2022
When tackling this issue we should set up an example chrome extension to properly test our fix.
I think it also might be a good idea to rethink how we make use of
getGlobalObject()in the SDK. Right now it basically acts as a type cast and is very error-prone.dchenk commentedon Dec 15, 2022
I'm getting a similar error (
Cannot read properties of undefined (reading 'email')) originating fromchrome-extension://dbilanlcioamaadkbepcenpombaejbla/dist/inject_content.jsbut I've got a normal app, not a Chrome extension.gnir-work commentedon Jan 2, 2023
Hello there :)
Me and my team are developing a manifest V3 extension and I cant explain how much sentry has helped us so far!
We wanted to take our monitoring to the next level with sentry tracing, however we encourted the same thing as described in this issue. After some playing around we managed to bypass the current usage of
WINDOW.document.visibilityStatelike this:Ofcourse this isn't a long term solution and we will update as soon as this issue is closed 😄
BTW, if there are other people arriving on this thread while trying to add tracing to their manifest V3 extension make sure that you create a new transaction around the code that you need to be traced. It took us quite some time to understand that there is no transaction like
pageloador something similar in extensions (This is my speculation after debugging for quite some time, in case I am mistaken please correct me 😄).Hope this helps :)
abhishek871 commentedon May 29, 2023
Is ur issue resolved now??
As I am also getting the same error.
JUDE-EQ commentedon Jun 15, 2023
I'm also getting this error.
lforst commentedon Jun 23, 2023
@abhishek871 @JUDE-EQ Usually these errors originate from browser extensions that your users are using. You can filter these out with the
denyUrlsoption: https://docs.sentry.io/platforms/javascript/configuration/filtering/#decluttering-sentry42 remaining items
stevenmason commentedon Apr 18, 2024
Thank you for the response. 100% of the time, no errors are coming through when using
Sentry.captureException(e);lforst commentedon Apr 18, 2024
@stevenmason I think this is a separate issue. Would you mind opening a new one and providing a reproduction example? Thank you!
getsantry commentedon Jul 9, 2024
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you remove the label
Waiting for: Community, I will leave it alone ... forever!"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀