In my style.scss I am loading a scss file by using:
@use "bootstrap/functions";
Somewhat later in the style.scss I load another scss file called _variables.scss. In this file I also want to use the functions file, for example by doing:
$link-color: functions.theme-color("primary") !default;
@include functions.assert-ascending($grid-breakpoints, "$grid-breakpoints");
The problem is that I am getting the following error:
SassError: Module loop: this module is already being loaded.
┌──> src/assets/scss/bootstrap/_variables.scss
4 │ @forward "functions";
│ ^^^^^^^^^^^^^^^^^^^^ new load
╵
┌──> src/assets/scss/style.scss
22 │ @use "bootstrap/functions";
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━ original load
╵
I tried loading it with @use and @forward, I also tried not loading it to see if it can find it in the current context, but nothing works. What am I doing wrong?
I am using Webpack with the sass-loader that uses dart-sass.