preact icon indicating copy to clipboard operation
preact copied to clipboard

[Need help]Cannot read property 'animationstartfalse' of undefined

Open Stupidism opened this issue 3 years ago • 4 comments

  • [ ] 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

image

To Reproduce

environment: image

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

Stupidism avatar Jul 05 '21 04:07 Stupidism

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.

marvinhagemeister avatar Jul 05 '21 06:07 marvinhagemeister

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

JoviDeCroock avatar Jul 05 '21 08:07 JoviDeCroock

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

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:

  1. The error happens only on two machines 35.229.126.86 and 35.203.150.252. By looking up their IPs, I found they belong to Google Cloud, so I think they must be google spiders.

image

image

  1. The error only occurs on two pages:

image

image

https://stage.getjerry.com/advice/widget-demo https://getjerry.com/advice/compare-and-save-insurance

Stupidism avatar Jul 21 '21 07:07 Stupidism

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

michael-graves-dojo avatar Mar 08 '22 15:03 michael-graves-dojo