Skip to content

NG0953 is an undocumented breaking behavior should be made optional #60110

@sherlock1982

Description

@sherlock1982

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

core

Is this a regression?

Yes

Description

Angular migrations guide (https://angular.dev/reference/migrations/outputs) suggests to migrate @Output decorators to output functions.
Though it brings in NG0953 errors if output is used after component is destroyed (see #19826 )

NG0953 is not anyhow mentioned in https://angular.dev/reference/migrations/outputs

There's no such page as https://angular.dev/errors/NG0953

Is is not easy to catch these errors after migration (especially if you do not expect them)

This error can be indication of a memory leak or a performance issue but doesn't cause any unexpected behavior

So what I can suggest:

  1. Improve documentation
  2. Make NG0953 configurable for example via extendedDiagnostics
  3. From my understanding NG0953 is also emitted in some other cases so probably this specific case should have a dedicated error?

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

NG0953: Unexpected emit for destroyed `OutputRef`. The owning directive/component is destroyed

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

Angular CLI: 19.1.7
Node: 22.11.0
Package Manager: yarn 4.6.0
OS: win32 x64

Angular: 19.1.6
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.7
@angular-devkit/build-angular   19.1.7
@angular-devkit/core            19.1.7
@angular-devkit/schematics      19.1.7
@angular/cdk                    19.1.4
@angular/cli                    19.1.7
@schematics/angular             19.1.7
rxjs                            7.8.2
typescript                      5.7.3
webpack                         5.98.0
zone.js                         0.15.0

Anything else?

P.S. For example unexpected crash on animation done event after component is destroyed (not trivial to resolve btw):

@HostListener('@flyInOut.done')
onAnimationEnd() {
      this.animationDone.emit(this.state);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreIssues related to the framework runtimearea: docsRelated to the documentation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions