-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(replay): Better guard for logger.info
#8873
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
Conversation
Not sure if/why this should be required, but better safe then sorry I guess... Hopefully fixes #8741
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't go through with this change. There is no way this is doing anything except bloating unless there is something really really funky going on.
I'd rather look into situations where logger
may be undefined. (i.e. accessing it without having the utils package loaded for some reason)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm not sure how this can happen but perhaps info
was tree-shaken out for some reason? This guard might work as long as __SENTRY_DEBUG__
isn't replaced by users.
Otherwise wdyt about checking for typeof logger.info === 'function'
?
Honestly I am also not clear why/how this is happened, but it def. started happening once we replaced __DEBUG_BUILD__ && logger.info()`
// became
if(!__DEBUG_BUILD__) {
return;
}
logger.info() To me it appears that this should be the same thing, but 🤷 . To be clear this is happening for us on sentry.io as well: https://sentry.sentry.io/issues/4387494961/?project=11276&referrer=github_integration so it cannot be related to a build issue. I strongly suspect it is related to some browser extension stuff or similar, but it's hard to say. As it happens for users too, we should somehow guard against this. Feels hacky, but 🤷 But yeah, maybe it is cleaner to do |
My suspicion is that this is happening with multiple sentry instances on the same page. (browser extensions) |
Maybe it is related to this...
OK, I rewrote this to use |
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be helpful to log what info
is when it is not a function
Closing in favor of #8880, which maybe/hopefully also fixes this. |
Not sure if/why this should be required, but better safe then sorry I guess...
Hopefully fixes #8741