@use is coming soon, but it's not supported in this version of Dart Sass
Asked Answered
K

4

19

I am running ng serve with an Angular cli project which includes Sass. I have been using @import and @include with no problem, when I added @use, the terminal throws:

@use is coming soon, but it's not supported in this version of Dart Sass.

My package.json uses "sass": "1.25.0", which according to the official documentation, @use has been supported since 1.23.

Is there something I'm missing?

UPDATE: I see that Angular lists Sass as a dependency in package-lock.json but with an older version. How can I make it to match the package.json version? I tried changed manually, run npm i --save but then package-lock.json reverts to the older version.

UPDATE 2 - Feb 2020: Even both package-lock.json and package.json show that use a 1.25.0 version of Sass, still can't use @use

Karmakarmadharaya answered 2/2, 2020 at 21:44 Comment(2)
Try deleting your package-lock.json and node_modules directory and run an npm install againSnicker
that doesn't work. the package-lock.json lists an older version of sass.Karmakarmadharaya
F
2

Take a look at using package overrides in the npm docs Another option is using patch-package

Add the following to your package.json

{
  "overrides": {
    "sass": "1.57.1"
  }
}
Femme answered 24/1, 2023 at 9:36 Comment(0)
P
1

If you want to use @use, then go to package.json and update dart-sass

{
    "dart-sass": "^1.25.0"
}
Psychrometer answered 30/9, 2021 at 15:36 Comment(0)
S
1

May 2023 update,

With the latest version of Angular (15+ and maybe lower),

you don't need to import anymore the sass package and @use is working as expected.

Shunt answered 5/5, 2023 at 8:3 Comment(0)
S
-4

Have you tried with caret (^)?

Like:

 "sass" : "^1.25.0"
Sherris answered 11/4, 2020 at 12:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.