jechav / tiny-slider-react

wrapper of tiny-slider plugin for react.
https://tiny-slider-react-tests.netlify.app/
47 stars 27 forks source link

Global CSS cannot be imported from within node_modules. #15

Closed Aryan-mor closed 4 years ago

Aryan-mor commented 4 years ago

Error on using tiny slider react in NextJs.

[ error ] ./node_modules/ventura-slider/dist/tiny-slider.css Global CSS cannot be imported from within node_modules.

Read more: https://err.sh/next.js/css-npm

Location: node_modules\tiny-slider-react\build\Carousel.js

Untitled

jechav commented 4 years ago

This should be addressed directly to the author of the library, since this is only a wrapper. https://github.com/ganlanyuan/tiny-slider

nicholasio commented 2 years ago

@jechav I don't think this is an issue with tiny-slider. The original implementation doesn't load the css by default it explicitly delegates to the consumer to load the CSS. The issue with your wrapper is that it makes an assumption about how every app is loading CSS.

This issue should be resolved by simple removing the line that loads the CSS, ship the compiled css to npm, then updating instructions to let users now that they should load the CSS themselves.