2

I installed Swiper npm install swiper. If I want to add Swiper Scss in the Global SCSS like described here https://ionicframework.com/docs/angular/slides I get a Error Message ./src/global.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): [ng] SassError: Can't find stylesheet to import. [ng] ╷ [ng] 30 │ @import '~swiper/scss'; [ng] │ ^^^^^^^^^^^^^^ [ng] ╵ [ng] src/global.scss 30:9 root stylesheet [ng] [ng] ./src/global.scss?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js): [ng] HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): [ng] SassError: Can't find stylesheet to import I also tried removing the Package and installing it afterwards. It did not help. The topic Module not found: Can't resolve 'swiper/css' is simular, but it uses React and CSS. Does someone know how to fix this?

The keyboard folder is empty for example enter image description here

I expected, I can add the SCSS file in the Global SCSS and then try out those custom animations

Mark Baumann
  • 98
  • 10

1 Answers1

2

I can see you are trying to import ~swiper/scss, but when you actually go into the package you can see there is no file like that... that's why the compiler is complaining.

I think there is a mistake in the documentation.

This worked for me (for Ionic 6):

@import '~swiper/swiper.min.css';
@import '~@ionic/angular/css/ionic-swiper.css';

This first import might not be necessary, but I'm not sure. Maybe someone more experienced can give some definitive answer.

Viarus
  • 21
  • 2