Skip to content

Repeated DOM structure recreation warnings on Angular 18.2 #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kulitha opened this issue Oct 8, 2024 · 2 comments
Closed

Repeated DOM structure recreation warnings on Angular 18.2 #93

kulitha opened this issue Oct 8, 2024 · 2 comments

Comments

@kulitha
Copy link

kulitha commented Oct 8, 2024

Repeated warnings about recreation of DOM structure are displayed on console whenever there's a diff update. I am using Angular 18.2. I tried using this on a new Angular project using the exact demo that was provided for this package, but the warnings still persist.

ngx-diff.-.console.warnings.mp4

This is the warning that shows up in the console.

NG0956: The configured tracking expression (track by identity) caused re-creation of the entire collection of size 7. This is an expensive operation requiring destruction and subsequent creation of DOM nodes, directives, components etc. Please review the "track expression" and make sure that it uniquely identifies items in a collection. Find more at https://angular.dev/errors/NG0956

Relevant error link

It seems like it could be fixed by changing the tracking expression (most likely for the line difference).

Any help would be much appreciated!

@rars
Copy link
Owner

rars commented Oct 9, 2024

Thanks @kulitha. I've released v9.1.0 to address this. Please try that and let me know if you still have any problems.

@kulitha
Copy link
Author

kulitha commented Oct 9, 2024

Cheers! It's giving no warnings now and works perfectly. Thank you very much for the quick fix!

@kulitha kulitha closed this as completed Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants