couds / react-bulma-components

React components for Bulma framework
MIT License
1.2k stars 126 forks source link

[NEXTJS] Refusing to import components due to improper CSS imports #325

Closed blacksoulgem95 closed 3 years ago

blacksoulgem95 commented 3 years ago

Describe the bug

error - ./node_modules/react-bulma-components/lib/components/box/box.sass
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/react-bulma-components/lib/components/box/index.js

To Reproduce Steps to reproduce the behavior:

  1. Create a Nextjs package
  2. install react bulma components
  3. Add a component to any js that is not _app.js
  4. See error

Expected behavior The CSS should be imported as CSS Modules and not as plain CSS in components

Screenshots If applicable, add screenshots to help explain your problem.

Versions

Additional context Add any other context about the problem here.

couds commented 3 years ago

Hi @blacksoulgem95

if possible I would recommend to use v4 instead of v3. if that's not possible try to use the basic setup instead of the advanced https://github.com/couds/react-bulma-components/tree/v3.4.0#basic

V3 was not made to use css modules. IMO Bulma css it mean to be global (not to be use as CSS modules) it have a lot of cross modifiers

Please check basic configuration, you can instead of importing the whole bulma.css load each saas file. this way you have more control about hot the css its imported