3

Module not found: Error: Package path ./swiper.min.css is not expoot exported from package D:\Frontend\React\movie-app\node_mswiper rted fromodules\swiper (see exports field in D:\Frontend\React\movieles\swirts field-app\node_modules\swiper\package.json)

I'm getting this error and cant deploy the project. I am able to see it in localhost. Please help me out..

2 Answers2

3

As the documentation says: https://ionicframework.com/docs/react/slides

There are various different ways of importing the Swiper .css depending on what technologies you are using.

This is how it is imported in the documentation example

import 'swiper/swiper.min.css';

But just below that it says

Not using Create React App? You can import the Swiper CSS from swiper/css instead.

So in my case where I am developing my app in Ionic, my import would look like this:

import 'swiper/css';

There are other options as well depending on how you are styling your sheets.

For developers using SCSS or Less styles, Swiper also provides imports for those files.

For Less styles, replace css with less: import 'swiper/swiper.less';

For SCSS styles replace css with scss: import 'swiper/swiper.scss';

Hope it helps!

fonsdiaz
  • 31
  • 3
0

I got a similar error with svelte and webpack. I was a doing an attempt to update webpack's config.module.rules value. Removing this attempt fixed the error.

taubhi
  • 119
  • 1
  • 4