Swiper, Ionic 6, Angular: import with tilde is deprecated

Hello!
After some packages update i get this warning:

Warning: '/Users/francescodegiorgio/Progetti-Angular-Ionic/Sunset Beach Club/sunset-pwa/src/global.scss' imports '~swiper/scss' with a tilde. Usage of '~' in imports is deprecated.

Warning: '/Users/francescodegiorgio/Progetti-Angular-Ionic/Sunset Beach Club/sunset-pwa/src/global.scss' imports '~swiper/scss/autoplay' with a tilde. Usage of '~' in imports is deprecated.

Warning: '/Users/francescodegiorgio/Progetti-Angular-Ionic/Sunset Beach Club/sunset-pwa/src/global.scss' imports '~swiper/scss/pagination' with a tilde. Usage of '~' in imports is deprecated.

how should I import those elements?

thanks

What swiper version is installed?

the latest one, “swiper”: “^8.4.3”,

In our app we removed the imports from the global.scss and added them in angular.json into the styles:

...,
"styles": [
    "src/theme/variables.scss",
    "src/global.scss",
    "node_modules/swiper/swiper.scss",
    "node_modules/@ionic/angular/css/ionic-swiper.css"
],
...

i think i’ll do the same now

solved doing this:

1 Like