While building my react app i got error as shown in picture and using "sass": "1.32.1" and bootstrap version 5.0.2. There is no any error while "npm start" but while building(npm run build in Jenkins), error occur.
Bootstrap 5.3.0 (latest at the moment) added support for dark and light modes.
I have solved the same problem (although unrelated to ReactJS) by adding new bootstrap source file variables-dark.scss, after already existing variables.scss in my main site.scss file:
More details can be found in Bootstrap Sass documentation for version 5.3 here.
Other, perhaps easier option, if your ReactJS framework does not support Bootstrap 5.3 yet is to lock version of Bootstrap in package.json file to 5.2.x for now:
2
Answers
Bootstrap 5.3.0 (latest at the moment) added support for dark and light modes.
I have solved the same problem (although unrelated to ReactJS) by adding new bootstrap source file
variables-dark.scss
, after already existingvariables.scss
in my mainsite.scss
file:More details can be found in Bootstrap Sass documentation for version 5.3 here.
Other, perhaps easier option, if your ReactJS framework does not support Bootstrap 5.3 yet is to lock version of Bootstrap in
package.json
file to5.2.x
for now:I think you need to specify Bootstrap version as 5.2.x, not above. Bootstrap 5.3 requires the import of scss/variables-dark