My Swipe.Js version : "^7.0.2"
Today, I attempted to use Swipe.Js and encountered an issue with my import code.
import { Swiper, SwiperSlide } from 'swiper/react';
as described on https://swiperjs.com/react#installation. However, when I tried to implement this code, I received the following error.
./src/App.jsx
Module not found: Can't resolve 'swiper/react' in 'C:\Users\User.LAPTOP-3EBUUP6S\Desktop\My future projects\new\smart-parking-system\src'
I then searched through the node_modules folder and located the files containing the Swiper
and SwiperSlide
functions. I attempted to import these files using the following line of code.
import { Swiper, SwiperSlide } from 'swiper/react/swiper-react.js';
Unfortunately, this also resulted in an error message like the following.
./node_modules/swiper/react/get-params.js
Module not found: Can't resolve 'swiper' in 'C:\Users\User.LAPTOP-3EBUUP6S\Desktop\My future projects\new\smart-parking-system\node_modules\swiper\react'
How can I resolve this import issue correctly? The documentation mentions changes from Swiper 6 to 7, but the examples provided are not functioning properly. As a result, I had to resort to manual imports based on what I found in the node_modules directory. However, even that approach failed to work for importing Swiper and SwiperSlide. What could be causing this problem?