heimrichhannot / contao-slick-bundle

A content slider/carousel for contao based on kenwheelers slick carousel.
3 stars 3 forks source link

Uncaught TypeError: $ is not a function #45

Closed abcmoritz closed 1 year ago

abcmoritz commented 3 years ago

Context Contao version: 4.11.5 Bundle version: 1.5.0 PHP version: 7.4

Since updating Contao the slick plugin throws me a js error:

Uncaught TypeError: $ is not a function
    at Function.value (jquery.min.js,jquery.touchSwipe.min.js,contao-utils-bundle.js,jq...-9e129a90.js:598)
    at jquery.min.js,jquery.touchSwipe.min.js,contao-utils-bundle.js,jq...-9e129a90.js:598
    at NodeList.forEach (<anonymous>)
    at HTMLDocument.value (jquery.min.js,jquery.touchSwipe.min.js,contao-utils-bundle.js,jq...-9e129a90.js:598)

var a = $(n).closest(".collapse");

Can someone help?

koertho commented 3 years ago

Looks live you haven't jquery on your page (or it's loaded after the slick script).

abcmoritz commented 3 years ago

We import jQuery in the Page Layout. Worked before and it's still getting imported. Can't figure out what changed with the update.

koertho commented 3 years ago

Please check if the jquery script is loaded before the slick script in the page source code and if the jquery-script promotes the window object properly (window.jquery and window.$). Which bundle version was installed before?