-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Nuxt build error #773
Comments
I managed to add it to Nuxt with making a plugin like this : installed the libs:
plugins/vue-awesomeSwiper.js import Vue from 'vue'
import {Swiper as SwiperClass, Pagination, Navigation, Mousewheel, Autoplay} from 'swiper/swiper.esm'
import getAwesomeSwiper from 'vue-awesome-swiper/dist/exporter'
// import style
import 'swiper/swiper-bundle.min.css'
SwiperClass.use([Pagination, Mousewheel, Navigation, Autoplay])
Vue.use(getAwesomeSwiper(SwiperClass))
nuxt.config.js plugins : [
{
src: '~/plugins/vue-awesomeSwiper.js', ssr: false},
...
] Then it worked for me. |
@rabichawila
If you can help, I'll be thank full. |
me,too. I used tailwindcss2.2.4. is there a problem? |
Same here. Used to work fine until I updated Nuxt to use the newer postcss |
@virkse @rabichawila @Josh979 You can rewrite swiper.css (related class): .swiper-button-prev,
.swiper-button-next {
position: absolute;
top: 50%;
width: calc(var(--swiper-navigation-size) / 44 * 27);
height: var(--swiper-navigation-size);
margin-top: calc(-1 * var(--swiper-navigation-size) / 2);
z-index: 10;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: var(--swiper-navigation-color, var(--swiper-theme-color));
} to .swiper-button-prev, .swiper-button-next {
position: absolute;
top: 50%;
/* width: calc(var(--swiper-navigation-size) / 44 * 27); */
--step1: calc(var(--swiper-navigation-size) / 44);
width: calc(var(--step1) * 27);
/**************/
height: var(--swiper-navigation-size);
/* margin-top: calc(-1 * var(--swiper-navigation-size) / 2); */
--step2: calc(-1 * var(--swiper-navigation-size));
margin-top: calc(var(--step2) / 2);
/**************/
z-index: 10;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
color: var(--swiper-navigation-color, var(--swiper-theme-color));
} |
This works for me!! Thankssss |
What version of swiper are you using? I tried it but still failed |
It works for me with |
has anyone gotten this error? Get this when trying to spin up local dev server.
|
I am facing this error when building my project, it works fine on development, but when i build i get an error:
~/plugins/swiper.js
nuxt.config.js
the error comes when i build
npm run build or npm run generate
The text was updated successfully, but these errors were encountered: