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

See original GitHub issue

This is a (multiple allowed):

  • bug

  • enhancement

  • feature-discussion (RFC)

  • Swiper Version: 6.3.5

  • Platform/Target and Browser Versions: Fails on build

swiper@^6.3.5:
  version "6.3.5"
  resolved "https://registry.yarnpkg.com/swiper/-/swiper-6.3.5.tgz#7444b680d0fdafe84859825ac3559b5b01bd1916"
  integrity sha512-MZkkVJ+sXukp6G3Z3BlKayhBjRIQuO1TZaTlH7ooI/0qbH0kkmItFMjFo19nOOsJaDXglA32xqyc9KCtmbJv0w==
  dependencies:
    dom7 "^3.0.0-alpha.7"
    ssr-window "^3.0.0-alpha.4"

What you did

import { Swiper } from 'swiper/swiper-react'

Expected Behavior

Swiper Component to be useable in tsx

Actual Behavior

wait  - compiling...
error - ./pages/index.tsx:7:0
Module not found: Can't resolve 'swiper/swiper-react'

from what I can tell the folder is present and contains a package.json file, but then does not resolve the actual code - I do get the type validation

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
ZhengRuicommented, May 12, 2021

I am having the same issue, even though I am importing from “swiper/react”

1reaction
Cyralcommented, Feb 5, 2021

Any idea what caused this? My IDE (webstorm) also suggested to import it from swiper/swiper-react. Not sure where it gets that from, but it confused me for a bit until I noticed the docs were different. (I also have @types/swiper installed and I’m using TypeScript if that matters)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Can't resolve 'swiper/react' - Stack Overflow
Whenever I run my code it says, " Module not found: Can't resolve 'swiper/react' ". reactjs · swiper.js · Share.
Read more >
[Solved]-Module not found: Can't resolve 'swiper/react'-Reactjs
Fix Swiperjs on React It seems issue with latest version of swiperjs. uninstall swiperjs if you already added to your react project. npm...
Read more >
Set Up Swiper.js for React Slides [Example] - Ionic Framework
By default, Swiper for React does not import any additional modules. To use modules such as Navigation or Pagination, you need to import...
Read more >
Swiper React Components
By default Swiper React uses core version of Swiper (without any additional modules). If you want to use Navigation, Pagination and other modules,...
Read more >
swiper - npm
Swiper is not compatible with all platforms, it is a modern touch slider which is focused only on modern apps/platforms to bring the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found