Skip to content

Angular 17.3 ngOnInit running infinite loop with defer block #55036

Closed

Description

@dreamstar-enterprises

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

core

Is this a regression?

Yes

Description

Full documentation of issue here >>
https://stackoverflow.com/questions/78216445/angular-ngoninit-running-multipe-times-resulting-in-call-stack-error-with-sign

Wasn't a problem with Angular 17.01...

Please provide a link to a minimal reproduction of the bug

https://stackoverflow.com/questions/78216445/angular-ngoninit-running-multipe-times-resulting-in-call-stack-error-with-sign

Please provide the exception or error you saw

See here >> 
https://stackoverflow.com/questions/78216445/angular-ngoninit-running-multipe-times-resulting-in-call-stack-error-with-sign

Wasn't a problem with Angular 17.01

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

No response

Anything else?

No response

Activity

  1. added
    needs reproduction
    on Mar 25, 2024
  2. atscott commented on Mar 25, 2024

    @atscott
    Contributor

    Please provide a runnable reproduction, either in a Github repository or Stackblitz.

  3. dreamstar-enterprises commented on Mar 26, 2024

    @dreamstar-enterprises
    Author

    Done! Not sure if you can see the code and replicate the issue..
    UPDATE STACKBLITZ

    Here is what I managed to put onto Stackblitz
    https://stackblitz.com/edit/stackblitz-starters-aeguwd?file=src%2Fproject-parent%2Fproject-parent.routes.ts

  4. atscott commented on Mar 26, 2024

    @atscott
    Contributor

    @dreamstar-enterprises Thank you for the reproduction. @AndrewKushnir I simplified the reproduction quite a bit here: https://stackblitz.com/edit/stackblitz-starters-bmouvm. This seems pretty similar to #54864 where a component with imports causes an issue.

  5. added
    core: defer
    P2
    and removed
    needs reproduction
    on Mar 26, 2024
  6. dreamstar-enterprises commented on Mar 26, 2024

    @dreamstar-enterprises
    Author

    Thanks. I don't know what's causing it, but it just refuses to load both components in the defer block. project navigation gets repeatedly loaded, and router outlet, won't load project-detail (which is an empty component anyway). But I can load each component, when I comment one or the other out. The links also lose all their relative link referencing....

    Screenshot 2024-03-26 at 18 09 52 Screenshot 2024-03-26 at 18 10 12 Screenshot 2024-03-26 at 18 11 25
  7. dreamstar-enterprises commented on Mar 26, 2024

    @dreamstar-enterprises
    Author
    Screenshot 2024-03-26 at 18 14 18
  8. added
    area: core
    on Mar 26, 2024
  9. added this to the Backlog milestone on Mar 26, 2024
  10. dreamstar-enterprises commented on Mar 26, 2024

    @dreamstar-enterprises
    Author

    For more information, this does work! (But, i have other components, where I do need multiple components in a defer block, so, not sure what's going on with Angular 17.3). If put the components in nested defer blocks, inside the main defer block it also, strangely, works, but the components lose their relative link referencing, and reference from the app root...

    Screenshot 2024-03-26 at 18 47 47 Screenshot 2024-03-26 at 18 52 50
  11. AndrewKushnir commented on Mar 27, 2024

    @AndrewKushnir
    Contributor

    @dreamstar-enterprises I've confirmed that the root cause of this issue is the same as the one in #54864. We are working on a fix and I'll share an update once the fix is available.

  12. dreamstar-enterprises commented on Mar 27, 2024

    @dreamstar-enterprises
    Author

    Thank you! I really, really appreciate it. (I'll try to roll back to 17.01 if I can in the meantime)

  13. added a commit that references this issue on Mar 28, 2024
    35931d8
  14. added a commit that references this issue on Mar 28, 2024
    708ba81
  15. added a commit that references this issue on Mar 28, 2024
    86a359b
  16. dreamstar-enterprises commented on Mar 28, 2024

    @dreamstar-enterprises
    Author

    Thank you. The issue seems closed now. Do you know how I, myself, could get the changes. Or do I have to wait for the next published release?

  17. atscott commented on Mar 28, 2024

    @atscott
    Contributor

    Or do I have to wait for the next published release?

    There will be a release later today that includes the fix.

  18. AndrewKushnir commented on Mar 28, 2024

    @AndrewKushnir
    Contributor

    Quick update: the fix for this issue was merged and released as a part of Angular v17.3.2 (available on NPM). Please let us know if you still see the issue after updating to v17.3.2.

  19. dreamstar-enterprises commented on Mar 28, 2024

    @dreamstar-enterprises
    Author

    Its fixed! Works great! (like it did with 17.0.1). Thank you very much for listening to my request, and investigating / attacking the problem! I'm very grateful!

  20. angular-automatic-lock-bot commented on Apr 28, 2024

    @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.

  21. locked and limited conversation to collaborators on Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2area: corecore: defer

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions