Closed
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
17.3
Description
An error is thrown for production builds when following conditions are met:
- The angular appplication makes uses of material (for example MatDialog) but does not make use of MatButton (or MatRipple directly)
- The webpack builder is used (
@angular-devkit/build-angular:browser
) - It happens only when building in production mode (not in development mode)
The following error is thrown in JS console, and the app is broken:
TypeError: Cannot set properties of undefined (setting 'FADING_IN')
Note: since I could not reproduce this with the esbuild builder (@angular-devkit/build-angular:application
), this could very well be an issue related to the angular-cli instead of material itself. Since I am not 100% sure, I am reporting it here.
Reproduction
StackBlitz link: https://stackblitz.com/edit/sjwtcm-g8jwcl?file=src%2Fexample%2Fdialog-data-example.ts
Steps to reproduce:
- Open the StackBlitz link
- Check JS console to see the error
Expected Behavior
No errors, app works.
Actual Behavior
App is broken, an error is visible in the JS console:
TypeError: Cannot set properties of undefined (setting 'FADING_IN')
Environment
- Angular: 18.0.3
- CDK/Material: 18.0.3
- Browser(s): Google Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows