slick icon indicating copy to clipboard operation
slick copied to clipboard

Cannot read properties of undefined (reading 'setPosition')

Open avroemans opened this issue 1 year ago • 0 comments

short description of the bug / issue, provide more detail below.

We noticed a lot of Javascript errors popping up on customers of our website. The Javascript error read: Cannot read properties of undefined (reading 'setPosition')

We couldn't reproduce this problem for now but we still see errors coming in. I checked the source of the library and found the root of the problem: ret = _[i].slick[opt].apply(_[i].slick, args); Sometimes _[i].slick is undefined for a undefined reason. I'm not sure how this could happen, but it looks like some extra validation needs to be put in place here. Also to create the Slick slider if it isn't present yet.

====================================================================

What is the expected behaviour?

No client-side javascript errors and a working Slick slider

====================================================================

What is observed behaviour?

Javascript errors and the slider possibly not working correcrly.

====================================================================

More Details

Issue seems to only occur on Android devices. image image

I am using jQuery 3.4.1 and Slick 1.8.1

  • Did this work before? Unsure. As soon as we enabled client-side Javascript error logging, this problem came up.

avroemans avatar Feb 27 '24 14:02 avroemans