nolimits4web / swiper

Most modern mobile touch slider with hardware accelerated transitions
https://swiperjs.com
MIT License
39.84k stars 9.75k forks source link

Error with Swiper version 11: Pagination module not found #7668

Open MAGNET-CODE opened 2 months ago

MAGNET-CODE commented 2 months ago

Check that this is really a bug

Reproduction link

https://codesandbox.io/p/devbox/swiper-react-pagination-dynamic-qjjdsg?file=%2Fpackage.json%3A7%2C23

Bug description

When using Swiper version 11 with the Pagination module, I am encountering the following error: Module '"swiper"' has no exported member 'Pagination'. Did you mean to use 'import Pagination from "swiper"' instead? import { Pagination } from 'swiper/modules';

Expected Behavior

import { Swiper, SwiperSlide } from 'swiper/react'; import 'swiper/css'; import 'swiper/css/pagination'; import '@/styles/swiper.css'; import { Pagination } from 'swiper/modules';

function ProductImageSlider() { return ( <Swiper pagination={{ dynamicBullets: true, }} modules={[Pagination]} className="mySwiper"

Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 Slide 6 Slide 7 Slide 8 Slide 9

); }

export default ProductImageSlider;

Actual Behavior

Console Errors: Module '"swiper"' has no exported member 'Pagination'. Did you mean to use 'import Pagination from "swiper"' instead?ts(2614)

Swiper version

Swiper version: 11.x.x

Platform/Target and Browser Versions

Browser: [Your browser, e.g., Google Chrome 112.0]

Validations

Would you like to open a PR for this bug?

fassihah commented 2 months ago

Saya juga mengalami ini, apakah sudah ada jawaban untuk bug semacam ini??

@MAGNET-CODE