Flickity AsNavFor producing error in the console: "Uncaught TypeError: Cannot read properties of undefined (reading 'create')"

402 Views Asked by At

i'm using flickity as the instructions, but got this error warning in the console anybody know how to solve this?

enter image description here

enter image description here

Here is the current bundle package

<script src="https://unpkg.com/flickity-as-nav-for@3/as-nav-for.js"></script>
<script src="https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/flickity@2/dist/flickity.min.css">

i'm using flickity AsNavFor but it shown an error in the console, how do i get rid or solve of it?

typeof Require enter image description here

2

There are 2 best solutions below

3
adsy On

Change the order of your script tags:

<script src="https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js"></script>
<script src="https://unpkg.com/flickity-as-nav-for@3/as-nav-for.js"></script>
<link rel="stylesheet" href="https://unpkg.com/flickity@2/dist/flickity.min.css">
0
Shapeshifter On

I had the same issue. This is what fixed it for me.

Swap out: <script src="https://unpkg.com/flickity-as-nav-for@3/as-nav-for.js"></script>

with: <script src="https://unpkg.com/flickity-as-nav-for@2/as-nav-for.js"></script>