Skip to content

Updating Material from 11 to 12 removes the theme in the styles.scss but forgets to add it back to the angular.json #22697

@msieurtoph

Description

@msieurtoph

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

I have not seen this bug during previous migrations

Description

During the update of Material from 11 to 12, the link to the theme has been automatically removed from the style.scss file (aka
this line has been removed : @import "~@angular/material/prebuilt-themes/indigo-pink.css")
But it has not been automatically added back to the styles array of the angular.json.

🔬 Minimal Reproduction

(sorry I don't know the command line for each step, specially the first one that needs to create a project in version 11)

  1. Create new project in version 11 with the cli and add Material support.
  2. Add a theme to the style.scss (@import "~@angular/material/prebuilt-themes/indigo-pink.css")
  3. Launch the ng update @angular/material

You will see the line has been removed from the styles.scss file ... but no add to styles arry of the angular.json file.

🔥 Exception or Error




// no error is returned

🌍 Your Environment




$ ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 12.0.0
Node: 14.15.1
Package Manager: npm 6.14.8
OS: win32 x64

Angular: 12.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, material, material-moment-adapter
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1200.0
@angular-devkit/build-angular   12.0.0
@angular-devkit/core            12.0.0
@angular-devkit/schematics      12.0.0
@schematics/angular             12.0.0
rxjs                            7.0.1
typescript                      4.2.4

Anything else relevant?

Metadata

Metadata

Assignees

Labels

P2The issue is important to a large percentage of users, with a workaroundarea: ng-updateIssues related to `ng-update` integration

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions