0
[WARNING] 2 repetitive deprecation warnings omitted.
Run in verbose mode to see all warnings. [plugin angular-sass]

    angular:styles/global:styles:1:8:
      1 │ @import 'src/theme/global.scss';
        ╵         ~~~~~~~~~~~~~~~~~~~~~~~

  null


▲ [WARNING] Deprecation [plugin angular-sass]

    src/theme/global.scss:27:8:
      27 │ @import './variables.scss';
         ╵         ^


  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

  The plugin "angular-sass" was triggered by this import

    angular:styles/global:styles:1:8:
      1 │ @import 'src/theme/global.scss';
        ╵         ~~~~~~~~~~~~~~~~~~~~~~~


▲ [WARNING] Deprecation [plugin angular-sass]

    src/theme/global.scss:28:8:
      28 │ @import './fonts.scss';
         ╵         ^


  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

  The plugin "angular-sass" was triggered by this import

    angular:styles/global:styles:1:8:
      1 │ @import 'src/theme/global.scss';
        ╵         ~~~~~~~~~~~~~~~~~~~~~~~


▲ [WARNING] Deprecation [plugin angular-sass]

    src/theme/global.scss:29:8:
      29 │ @import './sizes.scss';
         ╵         ^


  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

  The plugin "angular-sass" was triggered by this import

    angular:styles/global:styles:1:8:
      1 │ @import 'src/theme/global.scss';
        ╵         ~~~~~~~~~~~~~~~~~~~~~~~


▲ [WARNING] Deprecation [plugin angular-sass]

    src/theme/global.scss:30:8:
      30 │ @import './miscellaneous.scss';
         ╵         ^


  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

  The plugin "angular-sass" was triggered by this import

    angular:styles/global:styles:1:8:
      1 │ @import 'src/theme/global.scss';
        ╵         ~~~~~~~~~~~~~~~~~~~~~~~


▲ [WARNING] Deprecation [plugin angular-sass]

    src/theme/global.scss:31:8:
      31 │ @import './positions.scss';
         ╵         ^


  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

  The plugin "angular-sass" was triggered by this import

    angular:styles/global:styles:1:8:
      1 │ @import 'src/theme/global.scss';
    ╵         ~~~~~~~~~~~~~~~~~~~~~~~

package.json

{
  "name": "",
  "version": "1.5.24",
  "author": "",
  "homepage": "",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --prod",
    "lint": "ng lint"
  },
  "private": true,
  "dependencies": {
    "@angular/cdk": "20.1.5",
    "@angular/common": "20.1.6",
    "@angular/core": "20.1.6",
    "@angular/forms": "20.1.6",
    "@angular/platform-browser": "20.1.6",
    "@angular/platform-browser-dynamic": "20.1.6",
    "@angular/router": "20.1.6",
    "@capacitor-community/sqlite": "5.0.0",
    "@capacitor-firebase/authentication": "5.1.0",
    "@capacitor/android": "5.2.3",
    "@capacitor/app": "5.0.0",
    "@capacitor/camera": "5.0.0",
    "@capacitor/core": "5.2.3",
    "@capacitor/filesystem": "5.2.1",
    "@capacitor/haptics": "5.0.0",
    "@capacitor/ios": "5.2.3",
    "@capacitor/keyboard": "5.0.0",
    "@capacitor/network": "5.0.0",
    "@capacitor/preferences": "5.0.0",
    "@capacitor/splash-screen": "5.0.0",
    "@capacitor/status-bar": "5.0.0",
    "@ionic/angular": "8.7.2",
    "@sentry/angular": "^9.38.0",
    "@sentry/capacitor": "2.1.0",
    "@types/lodash": "4.14.178",
    "dayjs": "1.10.7",
    "firebase": "9.6.10",
    "guid-typescript": "1.0.9",
    "lodash": "4.17.21",
    "native-run": "^2.0.1",
    "rxjs": "7.5.0",
    "tslib": "2.8.1",
    "zone.js": "0.15.1"
  },
  "devDependencies": {
    "@angular-eslint/builder": "20.1.1",
    "@angular-eslint/eslint-plugin": "20.1.1",
    "@angular-eslint/eslint-plugin-template": "20.1.1",
    "@angular-eslint/template-parser": "20.1.1",
    "@angular/build": "^20.1.5",
    "@angular/cli": "20.1.5",
    "@angular/compiler": "20.1.6",
    "@angular/compiler-cli": "20.1.6",
    "@angular/language-service": "20.1.6",
    "@capacitor/cli": "5.0.0",
    "@ionic/angular-toolkit": "^11.0.1",
    "@sentry/cli": "2.20.7",
    "@types/node": "12.11.1",
    "@typescript-eslint/eslint-plugin": "8.39.1",
    "@typescript-eslint/parser": "8.39.1",
    "eslint": "9.33.0",
    "eslint-plugin-import": "2.32.0",
    "eslint-plugin-jsdoc": "54.0.0",
    "eslint-plugin-prefer-arrow": "1.2.3",
    "prettier": "2.5.1",
    "ts-node": "8.3.0",
    "typescript": "5.8.3"
  },
  "description": ""
}

global.scss

/ *
 * App Global CSS
 * ----------------------------------------------------------------------------
 * Put style rules here that you want to apply globally. These styles are for
 * the entire app and not just one component. Additionally, this file can be
 * used as an entry point to import other CSS/Sass files to be included in the
 * output CSS.
 */

/* Core CSS required for Ionic components to work properly */
@import '@ionic/angular/css/core.css';

/* Basic CSS for apps built with Ionic */
@import '@ionic/angular/css/normalize.css';
@import '@ionic/angular/css/structure.css';
@import '@ionic/angular/css/typography.css';
@import '@ionic/angular/css/display.css';

/* Optional CSS utils that can be commented out */
@import '@ionic/angular/css/padding.css';
@import '@ionic/angular/css/float-elements.css';
@import '@ionic/angular/css/text-alignment.css';
@import '@ionic/angular/css/text-transformation.css';
@import '@ionic/angular/css/flex-utils.css';

/*  Custom Styles */
@import './variables.scss';
@import './fonts.scss';
@import './sizes.scss';
@import './miscellaneous.scss';
@import './positions.scss';
@import './colors.scss';
@import './ionic-custom.scss';

I upgraded my app to Angular 20+, and now it displays warnings. Can you tell me how to remove those warnings?

1 Answer 1

0

Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

You're getting this error message because the @import rule in Sass is deprecated. The Sass introduced the module system (@use and @forward), which is a more modern and secure solution, and for this reason the old @import is being phased out.

These are only warnings for now, but in Dart Sass 3.0.0 they will be completely removed, so in the future they will throw an error.

Previously, you didn't encounter these warnings because earlier versions of Angular required older versions of Sass.

@use

The @use rule loads mixins, functions, and variables from other Sass stylesheets, and combines CSS from multiple stylesheets together. Stylesheets loaded by @use are called "modules". Sass also provides built-in modules full of useful functions.

@forward

The @forward rule loads a Sass stylesheet and makes its mixins, functions, and variables available when your stylesheet is loaded with the @use rule. It makes it possible to organize Sass libraries across many files, while allowing their users to load a single entrypoint file.

Related:

Sign up to request clarification or add additional context in comments.

3 Comments

Could you please provide guidance on how to resolve this issue?
Based on how I fixed it, you need to replace @import with @use, or @forward, depending on your use case. Answer from AI: Use @use when you want to load a module and use its members in the current file; Use @forward when you want to create a module that re-exports other modules. EDIT: message format (hit enter too soon).
How did you resolve this? This is imported in the angular.json as a global style. angular:styles/global:styles:1:8: 1 │ @import 'src/theme/global.scss'; ╵ ~~~~~~~~~~~~~~~~~~~~~~~

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.