Webpack build fails with "SassError: Undefined variable" when updating 5.1.3 -> 5.2.0
See original GitHub issuePrerequisites
- I have searched for duplicate or closed issues
- I have validated any HTML to avoid common problems
- I have read the contributing guidelines
Describe the issue
When updating 5.1.3 -> 5.2.0 our webpack build fails with the following error:
error in ./assets/scss/app.scss
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Undefined variable.
╷
142 │ values: $utilities-border-colors
│ ^^^^^^^^^^^^^^^^^^^^^^^^
╵
node_modules/bootstrap/scss/_utilities.scss 142:15 @import
assets/scss/app.scss 14:9 root stylesheet
That line just imports the utilities @import "~bootstrap/scss/utilities";
Reduced test cases
Don’t know how to provide a test case for this as we don`t even use that variable.
What operating system(s) are you seeing the problem on?
Linux
What browser(s) are you seeing the problem on?
No response
What version of Bootstrap are you using?
5.2.0
Issue Analytics
- State:
- Created a year ago
- Reactions:14
- Comments:13 (2 by maintainers)
Top Results From Across the Web
node.js - SassError: Undefined variable. Failing dependencies
I have a CI/CD pipeline for an Angular project which yesterday worked fine, but today the same code is returning several errors on...
Read more >Add bootstrap colors - Developers Community by KeenThemes
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Undefined variable. ╷ 7 │ $all-colors: map-merge-multiple($ ...
Read more >React.js Developers | Webpack 5 (with Module Federation) | Facebook
Webpack build fails with "SassError : Undefined variable" when updating 5.1.3 -. GITHUB.COM. Webpack build fails with "SassError: Undefined variable" when ...
Read more >Bootstrap 5.2.0 beta
To summarize the problem, Sass has a limitation where once a default variable or map has been used, it cannot be updated. There's...
Read more >Rails Webpacker and Sass undefined variable error
I've recently started using Webpacker with Rails as an alternative to the asset pipeline. In addition to compiling my Javascript assets I've ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for reporting this issue @gndk. There is a new
_map.scss
in v5.2.0. Don’t have the details regarding your Webpack build but you probably just need to@import "~bootstrap/scss/maps";
(that’s where$utilities-border-colors
is defined) before@import "~bootstrap/scss/utilities";
.@turkic-dev: It is important to load the modules in the exact same order as in node_modules/bootstrap/scss/bootstrap.scss Also, the following modules must be loaded