-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(Ripple): error "Cannot set properties of undefined (setting 'FADING_IN')" #27866
Comments
This is likely a tooling issue since we aren't doing anything complicated with that enum. Transferring into the Tooling repo. |
It looks like it's a buildOptimizer issue. The issue doesn't happen with |
I looked into this and found that Terser transforms the following code: var RippleState = /* @__PURE__ */ function(RippleState2) {
return RippleState2[RippleState2.FADING_IN = 0] = "FADING_IN", RippleState2[RippleState2.VISIBLE = 1] = "VISIBLE", RippleState2[RippleState2.FADING_OUT = 2] = "FADING_OUT", RippleState2[RippleState2.HIDDEN = 3] = "HIDDEN", RippleState2;
}(RippleState || {}); into: var RippleState=function(RippleState2){return RippleState2[RippleState2.FADING_IN=0]="FADING_IN",RippleState2[RippleState2.VISIBLE=1]="VISIBLE",RippleState2[RippleState2.FADING_OUT=2]="FADING_OUT",RippleState2[RippleState2.HIDDEN=3]="HIDDEN",RippleState2}(); This will require further investigation to provide a minimal reproduction for the Terser developers, as it is not reproducible when using just this piece of code. It seems to be influenced by other parts of the the bundle. |
I created a minimal reproduction and have reported the issue to Terser: terser/terser#1539 |
Is there some easy way to avoid this bug? Do I have to revert back to angular 17? |
|
This is not yet fixed upstream terser/terser#1539, will try to investigate if we can rollback terser to a previous version. Alternatively, you can update to the application builder which doesn’t make use of terser. |
@teolag what I did to work around this, is just add the matRipple directive on any element in your code (and disable it). It's a dirty workaround, but unblocks the upgrade to angular 18 when you are facing this issue... (Upgrading to the application builder would be better of course, but I'm working on that and will take some more time) |
@kfrederix Thank you for another work around. |
More information in terser/terser#1539 Closes angular#27866
More information in terser/terser#1539 Closes angular#27866
More information in terser/terser#1539 Closes angular#27866
More information in terser/terser#1539 Closes angular#27866
More information in terser/terser#1539 Closes #27866 (cherry picked from commit f49c8d3)
More information in terser/terser#1539 Closes #27866
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Is this a regression?
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:
@angular-devkit/build-angular:browser
)The following error is thrown in JS console, and the app is broken:
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:
Expected Behavior
No errors, app works.
Actual Behavior
App is broken, an error is visible in the JS console:
Environment
The text was updated successfully, but these errors were encountered: