question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG REPORT TEMPLATE

Vue.js version and component version

@vue/cli: 4.4.1 swiper: 6.0.4 vue-awesome-swiper: 4.1.1

Reproduction

I think everywhere, just install with npm install swiper vue-awesome-swiper --save

What is Expected?

No error when compile.

What is actually happening?

ERROR  Failed to compile with 1 errors

This dependency was not found:

* swiper/css/swiper.css in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/setting-box-carousel/SettingBoxCarousel.vue?vue&type=script&lang=js&

To install it, you can run: npm install --save swiper/css/swiper.css

And in node_modules/swiper/ there isn’t any cssfolder.


EDIT: I found a (temporary?) solution. I use import 'swiper/swiper-bundle.css' in my scss file.

EDIT2: As @Charlie50503 said, use import "swiper/swiper-bundle.min.css";.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:27
  • Comments:13

github_iconTop GitHub Comments

6reactions
ygj6commented, Oct 22, 2020

From the official README document, we can see :

Global Registration

import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper'

// import style (>= Swiper 6.x)
import 'swiper/swiper-bundle.css'

// import style (<= Swiper 5.x)
import 'swiper/css/swiper.css'

Vue.use(VueAwesomeSwiper, /* { default options with global component } */)

Local Registration

import { Swiper, SwiperSlide, directive } from 'vue-awesome-swiper'

// import style (>= Swiper 6.x)
import 'swiper/swiper-bundle.css'

// import style (<= Swiper 5.x)
import 'swiper/css/swiper.css'

export default {
  components: {
    Swiper,
    SwiperSlide
  },
  directives: {
    swiper: directive
  }
}
2reactions
aaroncdxcommented, Sep 2, 2021

image can help me with this? i even cant read the plugin in my nuxt project.

ps: please update the doc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Can't resolve 'swiper/css' - Stack Overflow
In recent versions of Swiper, there is no longer a css folder. So... to put it simply: swiper/css no longer exists.
Read more >
Getting Started With Swiper
Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior.
Read more >
[Solved]-Module not found: Can't resolve 'swiper/css'-Reactjs
If css files are not allowed to be imported individually, try adding them to the top root paths such as index.jsx. import 'swiper/swiper-bundle.css';....
Read more >
Getting Started With Swiper
Swiper is the most modern free mobile touch slider with hardware accelerated transitions and amazing native behavior.
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