-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
TypeError: Cannot read property 'target' of undefined #593
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
Can confirm it also happens on Chrome Mobile 45.0 and 46.0. |
I think, but are not sure, that error within my javascript is not created by an event such as a click, but just by code that is executed on page load. The tricky part is that I cannot reproduce any error in chrome on linux. I have seen the Sentry event now for 60 times already, so it is reproducable on the mobile (Android) device(s). Will continue investigate this... |
What version of Raven.js? The latest master (3.0.4) doesn't have a |
It has evt.target in the dist of this repo? Ah, in the src it is this part:
Around line 635 |
Any news on this? I had already 174k of these errors in 5 months time.. |
@gabn88 – it's hard for me to make progress on this without a page to reproduce the error. I suppose I can just bail out if there's no |
It is not a basic click/keypress handler. There are some timers running on the webapp that trigger events when the time is reached. So practically speaking, there is no target when the event triggers. But I think there are many cases where an event is not triggered by a click/keypress/touchstart, etc... |
Same error here guys! there are no errors being triggered on the page without sentry, however this same error on raven pops up when activating sentry. Stack: Web Components The bit that is causing the error on Raven is as commented out below. I had to use another alternative which is very odd. |
Your failing example looks like a classic case of not binding setTimeout(this.onOverlayClick.bind(this), 100); as will this: var self = this;
setTimeout(function () { self.onOverlayClick(); }, 100); as does your example with the arrow function thanks to how arrow functions handle this binding. Just doing setTimeout(this.onOverlayClick, 100); will not bind |
Thanks @LewisJEllis, that’s very insightful.
In the end raven error is not blocking any functionality since the methods still works just as fine, but seeing those errors throw in there was a bit strange. I will to see if I can reproduce that in isolation and provide you with an example anytime soon. |
@LewisJEllis if I understand correctly JS6 fat arrow |
@Sija - yes, I indicated that in my previous comment/linked to the MDN page on that behavior - that's why zanona's snippet in the screenshot doesn't trigger the problem @zanona - interesting; at best this is a confusing scenario for users to debug, and at worst it's a bug in raven-js. It might be a case of "error elsewhere ends up looking like error in raven-js" (like in #756 for example), but if everything works as expected without raven-js then I can't be sure of that. Either way there's something to improve, so please do let me know if you can provide a repro (even if it's not necessarily small/simple). |
Thansk @LewisJEllis will do. I will hopefully be able to provide a reproduction soon. Thanks |
@LewisJEllis true! I missed that part 😐 |
Closing due to long inactivity. Please feel free to reopen this issue if it's still relevant in any way. |
This happens at line 707 of raven.js for me while testing things.
browser = Chrome Mobile 42.0, level = error, logger = javascript, os = Android 4.4.2
Not exactly sure why it happens, maybe someone here has an idea?
The text was updated successfully, but these errors were encountered: