Mohamed Atef

3 Oct 2021

Module not found: Can't resolve 'swiper' in Reactjs [Solved]

React js

Swiper is not working in Reactjs 

Module not found: Can't resolve 'swiper' This error is happening when I try to import the swiper component to use it however I did everything as it exists in the documentation !! 
All I did is installing the package using this command 

npm i swiper

then import the module in the component 
like this 

import { Swiper, SwiperSlide } from 'swiper/react';

Once I add the line above I start getting this error !!!! 
Anyone can help?

— Solved

I tried a lot of solutions on the internet but no one works for me I still getting this error, so I start thinking about this is an error from the package itself, so I used an older version from the package using this command 

npm install swiper@6.8.4

when I did this, I saw a new folders has been added to the swiper folder in the node_modules and the website start working without no problem :)



19 Feb 2022

Hello Mohamed it seems to be fixed on the version 8.0.6
I did try it and didn't get the error. :)

© 2023 Copyrights reserved for