Skip to content

@for ExpressionChangedAfterItHasBeenCheckedError #52885

Closed

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

Activity

  1. added
    area: compiler
    core: control flow
    on Nov 14, 2023
  2. added this to the needsTriage milestone on Nov 14, 2023
  3. JeanMeche commented on Nov 14, 2023

    @JeanMeche
    Member

    Hummm, this looks like a compiler issue with a missing ɵɵadvance(), if any expert can confirm.

    If you add whatever interpolation before the for loop, the error vanishes (An ɵɵadvance() is correctly added to the compiled template).

  4. sysmat commented on Nov 15, 2023

    @sysmat
    Author

    @JeanMeche this is then a bug in @for but yes it is strange when empty interpolation is added error is gone

  5. atscott commented on Nov 15, 2023

    @atscott
    Contributor
  6. added
    P1
    on Nov 15, 2023
  7. modified the milestones: needsTriage, Backlog on Nov 15, 2023
  8. added a commit that references this issue on Nov 15, 2023
    98376f2
  9. angular-automatic-lock-bot commented on Dec 16, 2023

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  10. locked and limited conversation to collaborators on Dec 16, 2023
  11. added a commit that references this issue on Jan 23, 2024
    c79880e
  12. added 2 commits that reference this issue on Jan 26, 2024
    ec2d6e7
    88f55d1
  13. added a commit that references this issue on Jan 26, 2024
    0411cff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1area: compilerbugcore: control flowstate: has PR

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions