close

[Solved] Module not found: Can’t resolve ‘swiper/react’

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to use Swiper in my reactjs Application But I am facing following error Module not found: Can’t resolve ‘swiper/react’ in reactjs. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Module not found: Can’t resolve ‘swiper/react’ Error Occurs ?

Today I am trying to use Swiper in my reactjs Application But I am facing following error.

Module not found: Can't resolve 'swiper/react'

How To Solve Module not found: Can’t resolve ‘swiper/react’ Error ?

  1. How To Solve Module not found: Can’t resolve ‘swiper/react’ Error ?

    To Solve Module not found: Can’t resolve ‘swiper/react’ Error First of all downgrade your swiper version to swiper@6.0.2 And then import swiper like this. import Swiper from ‘swiper’;

  2. Module not found: Can’t resolve ‘swiper/react’

    To Solve Module not found: Can’t resolve ‘swiper/react’ Error First of all downgrade your swiper version to swiper@6.0.2 And then import swiper like this. import Swiper from ‘swiper’;

Solution 1: Import like this

  1. First of all downgrade your swiper version to swiper@6.0.2
  2. And then import swiper like this.
import Swiper from 'swiper';

Solution 2: Downgrade Swiper

Seems like this issue is with newest version of swiper So I recommend you to downgrade your swiper to swiper@6.0.2. Just follow this command.

  1. uninstall swiperjs if you already added to your react project
  • npm uninstall swiper

2. install Swiperjs version 6.0.2

  • npm install swiper@6.0.2

Solution 3: update your bundler/environment/framework/tooling

If you have such issue with Swiper 7, it means your bundler/environment/framework/tooling doesn’t support ESM packages. You should update your bundler/environment/framework/tooling or stay on Swiper 6.

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Leave a Comment