Comments (11)
why the ngFor behave different - its not much data and its tracked by the same property (overall its less than 1mb data)
NgFor didn't have any checks for the duplicated keys, this is a new and distinct feature of @for
from angular.
Please provide a minimal repro, either through StackBlitz or a Github repo, as without it this issue won't be actionable.
from angular.
A repro would be useful, but from the error and stack trace it looks like:
- your array/track fn are producing duplicate keys, which
@for
is trying to warn you about - as part of that warning, it calls
toString
on the array value - the
toString
implementation for the value itself is crashing, likely from trying to generate an exceptionally long string (hence the browser freeze)
from angular.
@alxhub thank you very much, that was exactly what happen. im still curious why the toString method crash and why the ngFor behave different - its not much data and its tracked by the same property (overall its less than 1mb data)
tried to create a stackblitz example but its behave differently there - no errors or warnings for the duplicated keys
from angular.
tried to create a stackblitz example but its behave differently there - no errors or warnings for the duplicated keys
The way you generate test data makes the key unique, hence no warning. I guess your real-life data are different and do have duplicate keys.
from angular.
The way you generate test data makes the key unique, hence no warning. I guess your real-life data are different and do have duplicate keys.
an duplicated key is explicit added at the bottom (for iterations lower 100)
edit: updated stackblitz to always generate the duplicated entry
from angular.
an duplicated key is explicit added at the bottom (for iterations lower 100)
edit: updated stackblitz to always generate the duplicated entry
Oh, the stackblitz runs Angular 17.3 while the new duplicate key check was only introduced in v18 (still RC). So the observed diff in warnings is likely due to the difference in Angular versions used.
from angular.
Oh, the stackblitz runs Angular 17.3 while the new duplicate key check was only introduced in v18 (still RC). So the observed diff in warnings is likely due to the difference in Angular versions used.
i posted "ng version" in the original issue text - its exactly the same version. maybe some angular.json configuration difference ? (we use nx, so im not sure if there is some hidden configuration applied)
from angular.
The check in question didn't land in v17.x: #55243
from angular.
the origin of the exception was a duplicated key that we could find and solve.
but even in this case, the generation of the exception message should not crash / freeze the browser - seems like there is still something wrong in generation of the message.
@pkozlowski-opensource hmm, than how can it be enabled in our 17.3.2 version ? even the html root component says it 17.3.2
from angular.
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.
from angular.
Related Issues (20)
- add signal with object to [(ngModel)] does not trigger changes in toObservable HOT 1
- docs: fix broken link on CONTRIBUTING.md page HOT 2
- Bazel Hot reloading broken
- Timeline for stabilization of RxJS Interop HOT 1
- Effect onCleanup cannot be triggered in unit test HOT 2
- TitleCasePipeComponent should be localized HOT 4
- Composed accent character input handling inconsistency HOT 2
- Update guide for version 18 - unclear (possibly incorrect?) instruction for opting out of caching HTTP requests that require authentication HOT 3
- Warning regarding "disabled" property of [formControl] family of directives refers to behavior thats specific to a subset of ControlValueAccessors, but shows up for all of them
- Browser Support page is inaccessible to unsupported browsers HOT 5
- HttpHeaders class discards multiple 'Set-Cookie' headers
- i18n extracts messages of own componentlib node module but isn't translating them
- Shadow DOM Style Bleeding HOT 1
- Is `RouteReuseStrategy` still supported? HOT 1
- Brave browser: error code attribute-directives HOT 2
- Add "delay" parameter to the "idle" trigger
- Form re-renders whole form while triggering validation after 18.1.0 HOT 3
- [doc] Incorrect Spelling and Value for `preserveWhitespaces` in Advanced Configuration HOT 2
- Add a note indicating in which specific version a feature was introduced HOT 2
- docs: The pipe ("|") character is not escaped in markdown tables HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular.