Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Global CSS cannot be imported from within node_modules. #15

Closed
Aryan-mor opened this issue Mar 11, 2020 · 2 comments
Closed

Global CSS cannot be imported from within node_modules. #15

Aryan-mor opened this issue Mar 11, 2020 · 2 comments

Comments

@Aryan-mor
Copy link

Aryan-mor commented Mar 11, 2020

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
Copy link
Owner

jechav commented Jun 27, 2020

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

@jechav jechav closed this as completed Jun 27, 2020
@nicholasio
Copy link

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants