Skip to content
Latchkey

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.

sass
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.scss

Common 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

  1. Run the official sass-migrator to rewrite @import to @use/@forward.
  2. Update member references to use namespaces.
  3. Rebuild and confirm the warnings are gone.
Terminal
npx sass-migrator module --migrate-deps src/styles/main.scss

Silence 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.

Terminal
sass --quiet-deps src/styles/main.scss dist/main.css

How to prevent it

  • Adopt the @use / @forward module system for new stylesheets.
  • Run the sass-migrator to convert existing @import usage.
  • Use --quiet-deps so third-party warnings do not fail CI mid-migration.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →