-
Notifications
You must be signed in to change notification settings - Fork 26
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
Assertion Failed: The response from a findQuery must be an Array, not undefined #22
Comments
@perlun Are you able to replicate this in the form of a test? // additional model: app/models/order-draft.js
import DS from 'ember-data';
var attr = DS.attr;
export default DS.Model.extend({
name: attr('string'),
});
// test: integration/crud-test.js
test('return empty list when model not exists', function() {
stop();
run(function() {
store.find('order-draft', { property: 'value'}).then(function(list) {
equal(list.get('length'), 0, 'list is empty');
start();
});
window.localforage.getItem('DS.LFAdapter').then(function (items) {
equal(items['order-draft'], null, 'no items in localforage');
});
});
}); This test passes perfectly for me. Or do I misunderstand your issue? |
Thanks for the quick reply. Yes, getting reproducibility on this would help in resolving the issue. Will check if I can make a (failing) test for this one. |
@perlun Thanks, let me know if you need some help. |
I've tried updating our app now to newer Ember (1.11) but now I seem to be getting really, really weird errors:
We are not using
Within this method, I realize that it may be hard to guess from a subset of details like this. Sorry, I don't have a more reproducible case at the moment but will gladly share more details as needed. |
@perlun I will try to update this project to ember 1.11 in the next few days. Are you having this problem only with Chrome again? Or is this error applicable to any browser? |
@perlun If you are right, and |
@perlun All tests pass with Ember 1.11. I'd love to help here, but advise you to checkout this repo, run tests with ember-cli ( |
@perlun What happends if you upgrade ember-data to dev-master? A few days ago a normalization bug related to Canary was fixed. |
Thanks for the very prompt reply. When I looked int he debugger, You're right in that I tested w/ Chrome Canary (when I reported the issue). Also tested w/ standard Chrome now, got the same error. Tested with Firefox dev edition, also seemed to behave similarly ( Any idea on how to try and narrow it down? It could very well be my setup with the Localforage adapter for sure. I.e., is the localforage serializer the one I am supposed to use and could this be triggered if I am not using it correctly? Like you say, reproducibility is key here, but also, just any pointer in how to debug this would be greatly appreciated... Thanks in advance. 😄 |
@perlun Could you create a very minimal script on jsbin that reproduces the error? There are some examples available that might help you. Kiitos! |
Yeah, I will try to do something along those lines (narrow down my use case to a bare minimum that reproduces the error). Will keep you posted. |
I think I have it now:
So something was happening while my app was booting up that caused this weirdness. I've nailed it down to my custom serializer:
I think the problem here lies in the use of Btw, is |
Ah, I think |
@perlun Great you found your solution! Can we close this issue then? |
Yes. Huge thanks for supporting me on this. I have a PR coming up re. the |
@perlun Great, looking forward to that! |
Hi,
Thanks for a nice piece of software. I get some errors when I try to query out data from my (offline) store using the LFAdapter:
The calling code basically looks like this:
The reason the error happens is because there are no
order-draft
items in the localforage (IndexedDB in my case, using Chrome Canary) storage. But it feels like the return value from the localforage adapter isn't really correct in this case...(As you can see, we are still on Ember 1.8.1. Are looking towards upgrading to 1.10 but the Handlebars/HTMLBars migration isn't trivial for us so therefore it hasn't really taken place yet.)
The text was updated successfully, but these errors were encountered: