I'm having trouble getting the math SASS library to work in a Vue app. It compiles with Dart Sass, and sass-loader. The Dart Sass version is 1.26.3
, so the math module should work.
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: There is no module with the namespace "math".
@for $i from 2 through 10
&:nth-child(#{$i}) { transition-duration: 300ms + $i * 50ms - 400ms * math.floor($i / 8); }
^^^^^^^^^^^^^^^^^^
}
Figured it out. I needed to add
@use 'sass:math';
at the top of the file.
What I could recommend you is an automatic (lazy) way - you may use:
$ npm install -g sass-migrator
$ sass-migrator division **/*.scss
From: https://sass-lang.com/documentation/breaking-changes/slash-div#automatic-migration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With