roylee0704 / react-flexbox-grid

A set of React components implementing flexboxgrid with the power of CSS Modules.
http://roylee0704.github.io/react-flexbox-grid/
2.93k stars 205 forks source link

Next.js Conflicts with CSS #173

Closed RealSGII2 closed 4 years ago

RealSGII2 commented 4 years ago

Description:

I am currently trying to use this system with my App that also uses Next.js. However, I am getting an error that states that react-flexbox-grid is importing global CSS and is being disallowed to. You can read more about this here: https://github.com/zeit/next.js/blob/master/errors/css-npm.md

According to Vercel:

Reach out to the maintainer and ask for them to publish a compiled version of their dependency. Compiled dependencies do not have references to CSS files, or any other files that require bundler-specific integrations.

It would be nice if it was compiled so that way I may use it.

Full Error:


Global CSS cannot be imported from within node_modules.
Read more: https://err.sh/next.js/css-npm
Location: node_modules\react-flexbox-grid\lib\classNames.js```
RealSGII2 commented 4 years ago

Oops, my bad. I've reread readme.md and found what I was missing. It's already been compiled to react-flexbox-grid/dist.

So basically, in order to fix this issue with Next.js:

nguyenmiinh0208 commented 3 years ago

I fixed my issue ! Thanks you very much !

jsnavarroc commented 3 years ago

That solution doesn't work, get an error alert with PropTypes. react-jsx-runtime.development.js:117 Warning: Failed prop type: Calling PropTypes validators directly is not supported by theprop-typespackage. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types Please check, thanks.