Open 0x0ece opened 9 years ago
I've been getting this since the beginning of my project 2 months ago, so it does apply to 0.4.x. I, too, am using an object that has an Array field with json values, so that seems to be the right path.
Is that mean I can't use Array type field and equalTo
method that Queries on Array Values
in official documents
This is happening to me with models without array type.
Any news about this issue? I'm still getting the warning "Attempted to flatten something that is not a Parse Object" on String arrays.
Edit:
To me it seems that the problem is in flatten.js
:
mappedFlatten(el)
tries to flatten every element of the array (by calling flatten(el)
), even if they are not Parse Objects.
+1. I have objects with arrays of strings. Why is this producing a warning? Thanks.
I had an array of objects in one Parse model. They looked like this: [{"date":"2012-09-09","note":"foo"},{"date":"2012-09-08","note":"bar"}]
I removed this data to its own Parse object and the error went away. Later, it resurfaced on another object that has a straight array of strings:
["foo","bar"]
I think the note above that someone was able to make this error happen without an array in their objects is maybe a red herring. This error is clearly heavily associated with this kind of object attribute. It might also be associated with some other condition, but that's somewhat immaterial to chasing down the most frequent cause.
If you're interested I added a pull request with a fix that is working (at least for me, need someone to confirm)... https://github.com/ParsePlatform/ParseReact/pull/157
Thanks @mmazzarolo, your change looks correct to me.
Since ParseReact 0.5 (but maybe also 0.4.x) I'm getting a lot of warnings "Attempted to flatten something that is not a Parse Object".
I suspect this happens on models with a filed of type Array that contains (json) objects. So like model Person, with field sons of type Array, and the actual value of John.sons = [{"name": "John Jr."}, ... ]