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

NextJs incompatibility: Global CSS cannot be imported from within node_modules. #192

Open
JohnMealy23 opened this issue Oct 18, 2020 · 5 comments

Comments

@JohnMealy23
Copy link

Looks like NextJs is incompat with your module's method for including CSS. I get the following error when attempting to include your package.

Failed to compile
./node_modules/react-images-upload/index.css
Global CSS cannot be imported from within node_modules.
Read more: https://err.sh/next.js/css-npm
Location: node_modules/react-images-upload/compiled.js

More of an FYI, though. Thanks for contributing to open source, and feel free to close this out if you have no interest in fixing!

@goffxnca
Copy link

Same problem

@sodatat
Copy link

sodatat commented Oct 26, 2020

Importing CSS files within node_modules cannot be supported
https://github.com/vercel/next.js/blob/master/errors/css-npm.md

@sebastiancrossa
Copy link

Running into the same issue

@JakeStanger
Copy link

Yep, same here. The best solution imo is to simply remove the import from index.js and then require users to import it themselves. This would also enable users to ship their own styles.

@jaywcjlove
Copy link

uiwjs/react-md-editor#52 (comment)

Perfect solution. @sodatat @JohnMealy23

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

6 participants