…produces this warning in the console: MyAppView:2: Unable to find key "someList.length".
The reason is that there’s a return in the getter that causes someList to be set to a Promise before it’s resolved with a different value.
The error is ok, but I think it would be better if it logged the value of the last property it can read, in this case someList. I think that would make it easier to see what someList is and why it doesn’t have a length property:
MyAppView:2: Unable to find key "someList.length". Found "someList" with value: %o
This example: https://codepen.io/anon/pen/zVXJzr?editors=0011
…produces this warning in the console:
MyAppView:2: Unable to find key "someList.length".
The reason is that there’s a
return
in the getter that causessomeList
to be set to a Promise before it’s resolved with a different value.The error is ok, but I think it would be better if it logged the value of the last property it can read, in this case
someList
. I think that would make it easier to see whatsomeList
is and why it doesn’t have alength
property:The
%o
would be replaced with thesomeList
value.Here’s an example of this type of error in can-bind: https://github.com/canjs/can-bind/blob/c010f16182b20ebfd0503422bc23230e9b3c5f20/can-bind.js#L531-L537
Here’s where the error is generated in this project: https://github.com/canjs/can-view-scope/blob/742532a35da4f88afefdbd00543095b047ea4112/scope-key-data.js#L77-L117
P.S. Can we remove the extra
\n
here? https://github.com/canjs/can-view-scope/blob/742532a35da4f88afefdbd00543095b047ea4112/scope-key-data.js#L111