Topic: How to implement SaSS with NextJS

Two Aow priority asked 1 year ago


Expected behavior I expect theming to work according to these instructions.... https://mdbootstrap.com/docs/react/content-styles/theme/

Actual behavior Using those instructions with NextJS just causes the application to hang. I have also tried moving the sass folder into the NextJS styles folder and that does not work either. and I have tried installing sass-loader in addition to sass however, if I just import "mdb-react-ui-kit/dist/css/mdb.min.css"; but I cannot change colors.

Resources (screenshots, code snippets etc.)


Grzegorz Bujański staff answered 1 year ago


If I understand correctly, it turned out that since NextJS v13.1.2 there is a problem with using Sass in NextJS and it is not strictly related to a bug in our package? We'll take a look at this and see what needs to be done to keep Sass working with NextJS correctly.


Two Aow priority commented 1 year ago

Yes,. This has nothing to do with MDBootstrap. It is a bug in NextJS > 13.1.1. But I thought I would leave the question to help anyone else facing the same issue.


Two Aow priority answered 1 year ago


I figured this out. NextJS 13.1.2 and above has a breaking change to their implementation of SASS. BEWARE: if you are using SASS, use only 13.1.1 and below.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • User: Priority
  • Premium support: Yes
  • Technology: MDB React
  • MDB Version: MDB5 5.1.0
  • Device: MacBook Pro
  • Browser: Chrome Version 109.0.5414.87 (Official Build) (x86_64)
  • OS: macOS Ventura
  • Provided sample code: No
  • Provided link: Yes