I can’t for the life of me figure out what’s going on. When I simply try to import Swiper, I get a breaking error. (Swiper included in package.json: "swiper": "^8.3.1",
)
Here’s my app.js:
import {domReady} from '@roots/sage/client';
import * as bootstrap from 'bootstrap';
import Swiper from 'swiper';
/**
* app.main
*/
const main = async (err) => {
if (err) {
// handle hmr errors
console.error(err);
}
new Swiper('.swiper');
/* ... additional JS */
};
/**
* Initialize
*
* @see https://webpack.js.org/api/hot-module-replacement
*/
domReady(main);
import.meta.webpackHot?.accept(main);
I get the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'call')
I’ve tried everything – removing all other js and imports to see if there is a conflict, various ways of importing, etc. with no luck. If I remove all Swiper references, my app works fine. Any ideas? Thanks.