-
-
Notifications
You must be signed in to change notification settings - Fork 79k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack build fails with "SassError: Undefined variable" when updating 5.1.3 -> 5.2.0 #36785
Comments
Thanks for reporting this issue @gndk. There is a new |
Thanks for the quick reply @julien-deramond ! That did the trick 👍. I only looked at the patch notes in the GitHub release, so I completely missed that. Will remember to check the migration page more in the future 🙂 |
Hello, I have this problem, how can I solve it? @gndk @julien-deramond |
@turkic-dev: It is important to load the modules in the exact same order as in node_modules/bootstrap/scss/bootstrap.scss
|
@import "~bootstrap/scss/functions"; use of the ~ is bad practice. Unless you show as I always do, you will generate errors. Here is what I always use: ex: @import "../node_modules/bootstrap/scss/_variables.scss"; I know there are little shortcuts available -- but why? |
FYI it's been solved in svelte-add/svelte-add#222 (comment) |
The problem was that I did not import 'scss/maps', 'scss/helpers' and 'scss/utilities/api' files |
Event fails after adding the map.scss in react project |
Hello, That's the same with parceljs, same solution #36785 (comment) Thanks, Omar |
See twbs/bootstrap#36785 (comment) for reference. The maps file is newly introduced in 5.2 and references a variable that is used in the utilities SCSS file.
I know I can just add the import |
@BearCooder You should not change anything in node_modules, ever. Add |
So I understanded it wrong in this thread. But still adding the import @import "~bootstrap/scss/maps"; in node_modules/bootstrap/scss/_utilities.scss resolved the issue that was mentioned at the beginning. |
Check the Doc at: https://getbootstrap.com/docs/5.2/customize/sass/#importing Note:- Comment all unnecessary functionality that you are not using. So that your compiled file will be as small as possible. |
yes it's also work for me |
In the _utilities.css, you can import the maps. @import "maps"; |
Prerequisites
Describe the issue
When updating 5.1.3 -> 5.2.0 our webpack build fails with the following error:
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
The text was updated successfully, but these errors were encountered: