user image

Mohamed Atef
Published in : 2021-10-03

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 :)

web-brackets.com
web-brackets.com

Comments

nico Date : 2022-02-19

Best answers

4

Best answers

4

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

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

[solved] Reactjs is not updating the props
Publish date: 2022-02-04 | Comments: 2

Tag: React js

[solved] useEffect is repeating the request Reactjs
Publish date: 2022-04-07 | Comments: 2

Tag: React js

import link as router link from 'react-router-dom' Reactjs
Publish date: 2021-09-30 | Comments: 3

Tag: React js

How to use Datepick of Mui with Formik
Publish date: 2022-02-14 | Comments: 6

Tag: React js

How to use SetFieldValue from outside render function? Formik
Publish date: 2021-07-03 | Comments: 2

Tag: React js