Sass "@import is deprecated" deprecation warning in CI
Dart Sass is phasing out @import in favor of the module system (@use / @forward). It emits a deprecation warning for each @import, which is noise normally but a hard failure when CI treats warnings as errors.
What this error means
The Sass build prints "Deprecation Warning [import]: Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0." possibly failing a strict step.
Deprecation Warning [import]: Sass @import rules are deprecated and will be
removed in Dart Sass 3.0.0.
More info and automated migrator: https://sass-lang.com/d/import
+-> src/styles/main.scssCommon causes
Stylesheets still use @import
Legacy @import statements trigger the deprecation warning on every compile under current dart-sass.
CI promotes Sass warnings to errors
A --quiet-deps omission or a wrapper that fails on stderr turns the warning into a non-zero exit.
How to fix it
Migrate @import to @use with the migrator
- Run the official sass-migrator to rewrite
@importto@use/@forward. - Update member references to use namespaces.
- Rebuild and confirm the warnings are gone.
npx sass-migrator module --migrate-deps src/styles/main.scssSilence dependency deprecations temporarily
While migrating your own code, suppress warnings from third-party imports so CI is not blocked by deps you do not control.
sass --quiet-deps src/styles/main.scss dist/main.cssHow to prevent it
- Adopt the
@use/@forwardmodule system for new stylesheets. - Run the sass-migrator to convert existing
@importusage. - Use
--quiet-depsso third-party warnings do not fail CI mid-migration.