metafizzy / flickity

:leaves: Touch, responsive, flickable carousels
https://flickity.metafizzy.co
7.53k stars 602 forks source link

Uncaught TypeError: this._dragPointerDown is not a function error #724

Closed howells closed 6 years ago

howells commented 6 years ago

Frustratingly, I can't reproduce a test case for this error I'm seeing when trying to drag a flickity instance, because I can't replicate it at all apart from on one project: it works perfectly elsewhere with the same setup.

The slideshow is in a React app but so are others where I don't see this error, so that shouldn't be the issue at all.

What could possibly cause this error do you think?

Full error:

drag.js?f52b:175 Uncaught TypeError: this._dragPointerDown is not a function
    at Flickity.proto._pointerDownDefault (drag.js?f52b:175)
    at Flickity.proto.pointerDown (drag.js?f52b:171)
    at Flickity.proto._pointerDown (unipointer.js?cbf6:128)
    at Flickity.proto.onpointerdown (unipointer.js?cbf6:107)
    at Flickity.proto.handleEvent (unipointer.js?cbf6:77)
aryehraber commented 6 years ago

Running into this too... I use Flickity in almost every project and not seen this error until today.

Perhaps a dependency is broken because pulling in a previous release still renders the same error.

aryehraber commented 6 years ago

I just tried using the CDN version instead of pulling in through NPM and the latest version works as expected — issue is most likely caused by a dependency.

Adding this before own script will fix temporarily:

<script src="https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js"></script>
Borange commented 6 years ago

Got the same problem. Seems to be in the unidragger dependency, the method _dragPointerDown has been removed.

https://github.com/metafizzy/unidragger/commit/6263d8fa8b64e522045aacf6f1954653df2f20ee#diff-bdf3066081d472b39cdd3d8bb82dc2d0

howells commented 6 years ago

@aryehraber strangely that doesn't help in my case

Borange commented 6 years ago

I found the problem and fixed it on my local installation and got it to work again. I made a pull request for it in the unidragger repository. Hopefully it will be approved and updated soon :)

macdaddyaz commented 6 years ago

In the meantime, I locked the unidragger dependency to version 2.2.3, and that works.

package.json:

    "resolutions": {
      "unidragger": "2.2.3"
    }
desandro commented 6 years ago

Looks like I introduced breaking changes in unidragger 2.3. I'll have a fix up in a couple days. Sorry for the hassle!

As mentioned ☝️ you can either use flickity.pkgd.js or specify unidragger: 2.2 as a dependency.

schellenbergk commented 6 years ago

I'm having trouble applying this temporary dependency fix. What am I doing wrong? in my app:

npm install flickity --save-dev

updated node_modules/flickity/package.json -> "unidragger": "2.2.3"

cd node_modules/flickity
npm install
gulp requirejs
gulp

then compiled my app but still getting the same error.

jmharveys commented 6 years ago

I'm having trouble applying the temporary dependency fix as well.

desandro commented 6 years ago

🎉 Flickity v2.1.1 has been released with a fix for this bug 🎉

Please update and report back if you still are running into issues.

aryehraber commented 6 years ago

Thanks for the quick fix @desandro!

aryehraber commented 6 years ago

p.s. I can confirm the latest version works when installed via npm

ChristophJeworutzki commented 6 years ago

Works like a charm! Thank you for the quick fix! @desandro

michaeljpowell commented 6 years ago

Works great! Thanks, @desandro

schellenbergk commented 6 years ago

Thanks! @desandro it works here too :)

desandro commented 6 years ago

Thanks for the confirmations. I'm closing this issue as resolved.

jpbaici commented 5 years ago

I am still seeing this issue installing flickity@2.1.2 via NPM.

I am able to resolve by installing unidragger@2.2.3 instead of 2.3.0

jetpack3331 commented 5 years ago

It's not resolved @desandro . It's still happening also on the version v2.1.1