react-images-upload icon indicating copy to clipboard operation
react-images-upload copied to clipboard

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

Open JohnMealy23 opened this issue 5 years ago • 5 comments

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!

JohnMealy23 avatar Oct 18 '20 02:10 JohnMealy23

Same problem

goffxnca avatar Oct 21 '20 04:10 goffxnca

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

sodatat avatar Oct 26 '20 07:10 sodatat

Running into the same issue

sebastiancrossa avatar Jan 01 '21 20:01 sebastiancrossa

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.

JakeStanger avatar Jan 01 '21 22:01 JakeStanger

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

Perfect solution. @sodatat @JohnMealy23

jaywcjlove avatar May 28 '21 02:05 jaywcjlove