-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
Yes, the previous migration from Angular Material 16 → 17 worked correctly. Angular Material 17.3.10
Description
When running the migration command to update @angular/material from version 17 to 18 using the Angular CLI, the process fails with the following error:
× Migration failed: Invalid regular expression: /*.define-light-theme(/: Nothing to repeat
It seems the migration script contains an invalid regular expression targeting define-light-theme() usage in SCSS files, possibly due to an unescaped / or *.
Reproduction
- Install Angular CLI and Angular Material 17 in a project.
- Ensure some use of define-light-theme() is present in SCSS (even if unused, the migration fails).
- Run: ng update @angular/material@18
Expected Behavior
The migration should correctly scan SCSS files and apply changes (if necessary) without failing due to a malformed regular expression.
Actual Behavior
The update process is interrupted due to a JavaScript exception caused by an invalid regular expression:
Invalid regular expression: /*.define-light-theme(/: Nothing to repeat
As a result, no migration is applied and developers must manually adjust their styles.
Environment
Angular CLI: 18.x
Node: 18.19.0
OS: Windows 10
Package manager: npm
Project Angular version: 18.2.14
@angular/material: 17.3.10 → 18.2.14
@angular/cdk: 17.3.10 → 18.2.14