Skip to content

@for ExpressionChangedAfterItHasBeenCheckedError #52885

@sysmat

Description

@sysmat

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

core

Is this a regression?

Yes

Description

  • after changing from *ngFor to @for control flow I get error: ExpressionChangedAfterItHasBeenCheckedError

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-jx5weg?file=demo%2Fsrc%2Fapp%2Fapp.component.ts

Please provide the exception or error you saw

instrument.js:123 Error: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked.

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

Angular CLI: 17.0.0
Node: 18.18.2
Package Manager: npm 10.0.0
OS: win32 x64

Angular: 17.0.2
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.0
@angular-devkit/build-angular   17.0.0
@angular-devkit/core            17.0.0
@angular-devkit/schematics      17.0.0
@angular/cli                    17.0.0
@schematics/angular             17.0.0
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2

Anything else?

reproduction https://stackblitz.com/edit/stackblitz-starters-jx5weg?file=demo%2Fsrc%2Fapp%2Fapp.component.ts

  • in terminal cd demo
  • in terminal pnpm install
  • in terminal pnpm run start
  • in browser open dev console and see the error

Metadata

Metadata

Assignees

Labels

P1Impacts a large percentage of users; if a workaround exists it is partial or overly painfularea: compilerIssues related to `ngc`, Angular's template compilerbugcore: control flowIssues related to the built-in control flow (@if, @for, @switch)state: has PR

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions