Open sdedieu opened 1 year ago
this just saved me after an hour of figuring out why my styles were broken after an ng material 14 -> 15 upgrade, despite using legacy components. this should at least be put as a known issue / step in the upgrade guide!
Command
update
Is this a regression?
The previous version in which this bug was not present was
No response
Description
The
ng update @angular/material@15
command update every@angular/material
import path in order to use the legacy classes. This behaviour prevents breaking the project using that command during a migration from v14 to v15. Sadly the script forget about updating theprebuilt-themes
path under theangular.json
file in thestyles
section.Minimal Reproduction
angular.json
file under thestyles
sections.ng update @angular/core@15 @angular/cli@15
to update core and cli to v15ng update/material@15
to update material to v15Every material classes import paths are automatically updated to use the legacy version example:
import { MatDialogRef } from '@angular/material/dialog';
is nowimport { MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog';
But style is broken since
prebuilt-themes
import wasn't updated.Expected behaviour
Exception or Error
No response
Your Environment
Anything else relevant?
No response