Error in multiple Swiper objects on Webpack

Connection example swiper on the Webpackwhich worked in version 5 but stopped working in Webpack 6

Previously, such a connection worked, which connected three blocks:

import Swiper from ‘swiper’;
import {eachSwiperHome} from ‘./common/swiper’;

new Swiper (‘. js-swiper-1’, eachSwiperHome);
new Swiper (‘. js-swiper-2’, eachSwiperHome);
new Swiper (‘. js-swiper-3’, eachSwiperHome);

After updating to the 6th version, the same scheme worked only in one copy and only if the connection was changed swiper / bundle:

import Swiper from ‘swiper / bundle’;
import {eachSwiperHome} from ‘./common/swiper’;
new Swiper (‘. js-swiper-1’, eachSwiperHome);

Didn’t bother to figure out if this is a Webpack settings issue. Rolled back to the previous version, where everything worked:

Similar Posts

Leave a Reply