Skip to content

can't find stylesheet to import "~@angular/material/theming"; #22412

@Karan653

Description

@Karan653

Which @angular/* package(s) are the source of the bug?

upgrade

Is this a regression?

No

Description

We have migrated our angular version from 11 to 12 and removed 'node-sass' in the favour of sass package , we have a shared library used across multiple mircro applications. While building library we are getting following isssue

can't find stylesheet to import "~@angular/material/theming";

we have tried different alternatives with and without tilday (~) and adding node_modules In the path. Please suggest if this is
bug or we have any resolution for that

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

can't find stylesheet to import "~@angular/material/theming";

Please provide the environment you discovered this bug in (run ng version)

"@angular-devkit/build-angular": "12.2.14",
    "@angular/animations": "~12.2.15",
    "@angular/cdk": "^12.2.13",
    "@angular/cli": "~12.2.14",
    "@angular/common": "~12.2.15",
    "@angular/compiler": "~12.2.15",
    "@angular/compiler-cli": "~12.2.15",
    "@angular/core": "~12.2.15",
    "@angular/elements": "~12.2.15",
    "@angular/forms": "~12.2.15",
    "@angular/language-service": "~12.2.15",
    "@angular/material": "~12.2.13",
    "@angular/material-moment-adapter": "~12.2.13",
    "@angular/platform-browser": "~12.2.15",
    "@angular/platform-browser-dynamic": "~12.2.15",
    "@angular/router": "~12.2.15",
      "ng-packagr": "^12.2.6",
       "sass": "^1.45.0",

Anything else?

Prior to this we were using angular 11 and node-sass where it was working fine and were using following import

@use "~@angular/material" as mat; ()

// CUSTOM THEME FOR ANGULAR MATERIALS
@import "node_modules/@angular/material/theming";

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions