Module not found: Can't resolve 'swiper/swiper-react'
See original GitHub issueThis 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:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am having the same issue, even though I am importing from “swiper/react”
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)