billy ponto
billy ponto

Reputation: 61

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

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

Upvotes: 2

Views: 559

Answers (2)

Shapeshifter
Shapeshifter

Reputation: 39

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>

Upvotes: 1

adsy
adsy

Reputation: 11417

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">

Upvotes: 0

Related Questions