See the following issues: https://github.com/webpack-contrib/sass-loader/issues/954 and https://github.com/sass/sass/issues/3065.
The quietDeps option isn't exposed yet to the Node.js API.
In the meantime you can downgrade to sass 1.32 without too many changes.
EDIT: It's now available in sass 1.35.1.
See the following issues: https://github.com/webpack-contrib/sass-loader/issues/954 and https://github.com/sass/sass/issues/3065.
The quietDeps option isn't exposed yet to the Node.js API.
In the meantime you can downgrade to sass 1.32 without too many changes.
EDIT: It's now available in sass 1.35.1.
For anyone who looking for Encore configuration
Encore.enableSassLoader((options) => {
options.sassOptions = {
quietDeps: true, // disable warning msg
}
})
Had to disable the huge intrusive overlay warning in my Webpack config. Will there be another release coming soon? The commits seem to fix that. But these were a few days ago...
To hide the warnings, update your vite.config.js like this:
export default defineConfig({
css: {
preprocessorOptions: {
scss: {
quietDeps: true
}
}
}
})
UPDATE: a critical requirement is that you have your paths relative to node_modules or another folder that SCSS is considering to hold external modules. These folders can be listed in loadPaths scss option (node_modules is included by default, at least when SCSS is run from Vite). And not relative to current file!
E.g. this path works - all warnings are excluded:
@forward 'spinkit/scss/spinners/7-three-bounce.scss';
This path doesn't work - all warnings are shown:
@forward '../../node_modules/spinkit/scss/spinners/7-three-bounce.scss';
This requirement can be understood by reading SCSS quietDeps option description.
A fresh solution for those who are looking for a way to fix the warning in Vite:
Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
The quietDeps: true rule mentioned above does not work for this warning.
The most preferable way is to make Vite to use modern API for SASS:
vite: {
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler', // or 'modern'
},
},
},
},
Vite docs: css.preprocessorOptions
But if you want to just silence deprecation warnings, use silenceDeprecations option:
vite: {
css: {
preprocessorOptions: {
scss: {
silenceDeprecations: ['legacy-js-api'],
},
},
},
},
SASS docs for silenceDeprecations SASS Deprecations list
Both solutions work on Vite 5.4.6, and Sass 1.79.1
Hi
I just updated a medium-large sized project to Angular 19 and now I'm getting flooded with sass warnings
Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
There were a few other warnings like map-merge, percentage
I managed to update those with the sass migrate tool sass-migrator module --migrate-deps
but I haven’t migrated the import warnings yet. I’m not really a CSS/Sass person, so I’m not sure where to even start. These were some files that I rarely touched and I can't just replace the imports with use for the existing scss files.
Anyone who had to face the same situation?
What steps did you take? Did you ignore the warnings or took time to fix it.
I'm using SvelteKit with sveltePreprocess and getting a million warnings:
Deprecation [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
No matter what I put in Svelte config or Vite config, I am not able to get SvelteKit to use modern-compiler or STFU about the warnings. Nothing presented here helps.
Has anyone had some success with this?