preact
preact copied to clipboard
[Need help]Cannot read property 'animationstartfalse' of undefined
- [ ] Check if updating to the latest Preact version resolves the issue
Describe the bug Our sentry reported this issue. And when I search the error message I got
To Reproduce
environment:
I have no idea how to reproduce at all. I might need help optimizing the sentry config before I can find how to reproduce it.
Expected behavior
Can you follow the stack trace and share the snippet that caused this issue? Hard to tell from the sentry screenshot what is going on as it just show that an error happened, but knowing that an error occured is not enough information to debug it.
Useful information that can help debug this issue is. Which component triggered the error? How does it look like? Where are you using animationstartfalse
?
One thing is for sure that animationstartfalse
is not a valid DOM attribute name. Maybe it should've been onanimationstart={false}
instead? Just shooting in the dark here. Really hard to make an educated guess without knowing more about what your code is like and where you are using that property.
My hunch would be that it happens here but DOM._listeners
being undefined
sounds quite.... exotic. Are you switching the event-handler somehow dynamically, the only way to get into eventProxy
is here where we set the dom._listeners
unless we somehow remove & replace that element properties in-place
My hunch would be that it happens here but
DOM._listeners
beingundefined
sounds quite.... exotic. Are you switching the event-handler somehow dynamically, the only way to get intoeventProxy
is here where we set thedom._listeners
unless we somehow remove & replace that element properties in-place
Thanks for your reply. Your guess looks very close and I understand I must provide more info. For now, I can only get two more info:
- The error happens only on two machines
35.229.126.86
and35.203.150.252
. By looking up their IPs, I found they belong to Google Cloud, so I think they must be google spiders.
- The error only occurs on two pages:
https://stage.getjerry.com/advice/widget-demo https://getjerry.com/advice/compare-and-save-insurance
I'm seeing a very similar error in the eventProxy function. The event having the error is different ("mouseleave" or "touchmove") in my case, however it causes a very similar exception.
In my case the easiest way to reproduce it is a button that is getting removed and being clicked on. The timing is a little tricky, but essentially I'm clicking on a button which causes that button to then disappear. Before it can go away I click on it again causing an exception in the eventProxy function. _listeners is not present on the element anymore when I get the timing right.
Are you switching the event-handler somehow dynamically, the only way to get into eventProxy is here where we set the dom._listeners unless we somehow remove & replace that element properties in-place
Not switching the event handler in this case, seems to be an element that is in the process of getting cleaned up.
I put up a draft PR that fixes the issue for me #3473