Skip to content
Advertisement

SwipeJS not functioning properly

My Swipe.Js version : "^7.0.2"

So I tried to use Swipe.Js today. When I’m importing I used this code line.

import { Swiper, SwiperSlide } from 'swiper/react'; 
as in https://swiperjs.com/react#installation.  But when I implement this I get error like this.
./src/App.jsx
Module not found: Can't resolve 'swiper/react' in 'C:UsersUser.LAPTOP-3EBUUP6SDesktopMy future projectsnewsmart-parking-systemsrc'

So I looked at the node_modules folder and then I found where is the Swiper and SwiperSlide functions are. So I imported that file by using this line. import { Swiper, SwiperSlide } from 'swiper/react/swiper-react.js';

But it also giving a error like this.

./node_modules/swiper/react/get-params.js
Module not found: Can't resolve 'swiper' in 'C:UsersUser.LAPTOP-3EBUUP6SDesktopMy future projectsnewsmart-parking-systemnode_modulesswiperreact'

So how to import this in a correct way? I saw that there is file changings from Swiper 6 to 7 in the documentation.(https://swiperjs.com/react#installation) But showings(like Styles Imports) of that link are not working. So I had to look at the node_modules and then had to do importing. But this importing Swiper and SwiperSlide is not working by the way. Why is that?

Advertisement

Answer

Downgrade your version to 6.8.4! It works like magic!

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement