Undefined mixin: _assert-ascending error found in node_modules\bootstrap\scss\_variables.scss #41356
-
I'm getting this error after I migrate the bootstrap to latest version (5.3) and replace node-sass to Error:
I'm using these libs and versions:
Here's my main.scss:
custom-variables.scss: // I also tried to add variables before the include
webpack config:
What I've tried so far:
Please help. I'm already questioning my life choices. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello there. // Your main Sass file
// 1. Include functions first (so you can manipulate colors, SVGs, calc, etc)
@import "../node_modules/bootstrap/scss/functions";
// 2. Include any default variable overrides here
@import "./custom-variables";
// 3. Include remainder of required Bootstrap stylesheets (including any separate color mode stylesheets)
@import "../node_modules/bootstrap/scss/variables";
@import "../node_modules/bootstrap/scss/variables-dark";
// 4. import the rest of Bootstrap depending on your needs // custom-variables.scss
$grid-breakpoints: (
xs: 0,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px
) !default;
// The following 2 lines can be removed as it's already done by _variables.scss
// But calling the mixins here actually works; you can for instance change the `xs: 0` to `xs: 12px` and see warnings in the console
@include _assert-ascending($grid-breakpoints, '$grid-breakpoints');
@include _assert-starts-at-zero($grid-breakpoints, '$grid-breakpoints'); Or you could get rid of IMHO, you should stick to using Hope it can be helpful to find where the exact problem comes from. If it's still not working, you could try to create a reproducible StackBlitz project, starting from https://github.com/twbs/examples/tree/main/sass-js (by clicking on the "Open in StackBlitz" button in the README). |
Beta Was this translation helpful? Give feedback.
Hello there.
I've tried to replicate a part of your environment locally with different build tools. In terms of pure Sass and usage of Bootstrap, and handling only
$grid-breakpoints
override, you can do that for instance: