JakeHartnell / react-images-upload

React input file component with images preview
https://jakehartnell.github.io/react-images-upload/
MIT License
347 stars 154 forks source link

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

Open JohnMealy23 opened 4 years ago

JohnMealy23 commented 4 years ago

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 commented 4 years ago

Same problem

sodatat commented 4 years ago

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

sebastiancrossa commented 3 years ago

Running into the same issue

JakeStanger commented 3 years ago

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 commented 3 years ago

https://github.com/uiwjs/react-md-editor/issues/52#issuecomment-848969341

Perfect solution. @sodatat @JohnMealy23