Skip to content

EventEmitter names starting with 'animate' trigger animations subsystem error in Angular >=20.2.0 #63466

@XLeapJak

Description

@XLeapJak

Which @angular/* package(s) are the source of the bug?

animations

Is this a regression?

Yes

Description

When an @Output() or output() EventEmitter property name starts with the string "animate", Angular incorrectly triggers its animations subsystem during component updates, causing a runtime error.

Reproduction:
in a component name an output() or @ Output() animateXYZ
bind to this output in a template (doesn't matter if it is conditionally rendered or not)
check console when component is rendered

Error Message:
Component update failed: ASSERTION ERROR: Expected ElementRegistry to be present in animations subsystem [Expected=> null != undefined <=Actual]
Expected Behavior:
EventEmitter names starting with "animate" should work normally without triggering the animations subsystem.

Actual Behavior:
Runtime error occurs when the component with the EventEmitter starting with "animate" is rendered.

Additional Context:
This appears to be a regression introduced in Angular 20.2 (no runtime error in 20.1.8). The issue seems to be related to Angular incorrectly identifying component properties as animation-related based on naming patterns.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/repro-jbkqpft2?file=package.json

Please provide the exception or error you saw

ERROR Error: ASSERTION ERROR: Expected `ElementRegistry` to be present in animations subsystem [Expected=> null != undefined <=Actual]
    at throwError2 (root_effect_scheduler.mjs:351:11)
    at assertDefined (root_effect_scheduler.mjs:347:9)
    at Module.ɵɵanimateLeaveListener (debug_node.mjs:22232:9)
    at App_Conditional_7_Template (app.ts:13:30)
    at executeTemplate (debug_node.mjs:7939:9)
    at renderView (debug_node.mjs:8555:13)
    at createAndRenderEmbeddedLView (debug_node.mjs:8625:9)
    at Module.ɵɵconditional (debug_node.mjs:22854:39)
    at App_Template (app.ts:12:17)
    at executeTemplate (debug_node.mjs:7939:9)

Please provide the environment you discovered this bug in (run ng version)

Angular: 20.2.2
... common, compiler, compiler-cli, core, forms
... platform-browser, router

Package                      Version
------------------------------------
@angular-devkit/architect    0.2002.1
@angular-devkit/core         20.2.1
@angular-devkit/schematics   20.2.1
@angular/build               20.2.1
@angular/cli                 20.2.1
@schematics/angular          20.2.1
rxjs                         7.8.2
typescript                   5.9.2
zone.js                      0.15.1

Anything else?

No response

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions