You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error trying to diff ‘[object Object]' needs to pass the error message #15402
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior Error trying to diff ‘[object Object]' Does not say what the actual error is. Once you get this, the path forward relies on diving into the angular source code since the error message was erased.
Expected behavior Error trying to diff ‘[object Object]': ReferenceError: Invalid left-hand side in assignment Does not drop the actual reason there was an exception raised.
Minimal reproduction of the problem with instructions
Unknown how to minimally reproduce, specifically because the error message is dropped. This is in fact, the exact problem.
What is the motivation / use case for changing the behavior?
Dedicate time to fixing the problem instead of everyone needing to go into the angular source code when the bug is probably (but don't know) in their own project.
Please tell us about your environment:
Ubuntu 16.04LTE, geany 1.27, ionic2
I cannot provide a minimum reproduction because it's private source code and I don't know which part triggers it, because the error is being hidden. I think the error comes from this line
I have this curious problem as well. However the error says "DeckEditComponent.html:61 ERROR Error: Error trying to diff '4'. Only arrays and iterables are allowed".
The "4" in question is the value passed in [ngValue]="user.id". When i change the ngValue to "user", the error changes to "trying to diff '[Object object]'". I have not a clue about why the code is trying to diff the ngValue...
The [] is why it's trying to diff. Look at my fix above. I basically rebuilt the += operator from scratch and it worked. Why? Who knows
It doesn't look like the error is coming from that line though. Is there an ngFor around that, like for user in users or something. If so, look at users
angular-automatic-lock-bot commented on Sep 13, 2019
Activity
DzmitryShylovich commentedon Mar 22, 2017
Please provide reproduction in plunkr
b264 commentedon Mar 22, 2017
I cannot provide a minimum reproduction because it's private source code and I don't know which part triggers it, because the error is being hidden. I think the error comes from this line
angular/packages/core/src/change_detection/differs/default_iterable_differ.ts
Line 160 in ea49a95
DzmitryShylovich commentedon Mar 22, 2017
debugger? probably ngClass/ngStyle/ngForTrackBy.
we can't fix what we can't reproduce
fix(core): improve error msg for invalid KeyValueDiffer.diff arg (#15489
b264 commentedon Mar 28, 2017
Thanks @DzmitryShylovich
b264 commentedon Mar 28, 2017
I did figure out that changing
this.data += results;todid fix the problem. Why -- I don't know. Which is troubling.
this.datawas being diff'd.fix(core): improve error msg for invalid KeyValueDiffer.diff arg (#15489
fix(core): improve error msg for invalid KeyValueDiffer.diff arg (ang…
fix(core): improve error msg for invalid KeyValueDiffer.diff arg (ang…
Daan298261 commentedon Dec 13, 2017
I have this curious problem as well. However the error says "DeckEditComponent.html:61 ERROR Error: Error trying to diff '4'. Only arrays and iterables are allowed".
The "4" in question is the value passed in [ngValue]="user.id". When i change the ngValue to "user", the error changes to "trying to diff '[Object object]'". I have not a clue about why the code is trying to diff the ngValue...
b264 commentedon Dec 13, 2017
The
[]is why it's trying to diff. Look at my fix above. I basically rebuilt the+=operator from scratch and it worked. Why? Who knowsIt doesn't look like the error is coming from that line though. Is there an ngFor around that, like for user in users or something. If so, look at users
angular-automatic-lock-bot commentedon Sep 13, 2019
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.