Scenario:
Currently, I am facing an issue with using the bootstrap 4 stylesheet in conjunction with NextJS. The bootstrap 4 stylesheet, compiled from SASS, contains code like:
.checkbox.checkbox-accent > span {
border-width: !important;
}
This specific code snippet is causing problems during the production build of NextJS. Upon running yarn build
, I encounter the following error:
yarn run v1.22.4
$ next build
info - Creating an optimized production build
Failed to compile.
TypeError: Cannot read property 'toLowerCase' of undefined
> Build error occurred
Error: > Build failed because of webpack errors
at /home/musa/codes/paisaha/finance-nextjs/node_modules/next/dist/build/index.js:441:19
at async /home/musa/codes/paisaha/finance-nextjs/node_modules/next/dist/build/tracer.js:1:1441
error Command failed with exit code 1.
However, by adding a value before the !important
in the CSS, such as:
.checkbox.checkbox-accent > span {
border-width: unset !important;
}
Query:
I am curious to know what exactly does !important
without a value signify? Is this a valid piece of CSS code, or could it be an issue related to SASS compilation, or perhaps something linked to the webpack compiler utilized by NextJS?
Additional Information:
yarn dev
functions correctly"dependencies": { "next": "10.0.6", "react": "17.0.1", "react-dom": "17.0.1" }
- NodeJS version: v12.18.2
- Platform: WSL2 on Windows 10