Closed ghost closed 1 year ago
We don't know what is your project structure looks like and what tool you using besides Drupal for importing modules from node_modules
So just a tip
import $ from 'jquery'
Object.assign(window, { $: jQuery, jQuery })
console.log(window) // window Object
// or put your code inside
window.addEventListener('load', () => {
//...
})
make sure jQuery
or $
and Flickity
is available in the window Object
I have jquery as jQuery, not $ Also I am using it inside Drupal behaviors. I installed it as yarn package.
import Flickity from "flickity";
In the end of day I get
Uncaught TypeError: jQuery(...).flickity is not a function