Skip to content
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

Issue with Null Result: "ember-data": "1.0.0-beta.14.1", #101

Open
Goldcap opened this issue Feb 23, 2015 · 3 comments
Open

Issue with Null Result: "ember-data": "1.0.0-beta.14.1", #101

Goldcap opened this issue Feb 23, 2015 · 3 comments
Labels

Comments

@Goldcap
Copy link

Goldcap commented Feb 23, 2015

So I've been using adapter with "ember-data": "1.0.0-beta.10", but after upgrading to beta.14.1 I get the following error. I'm doing this:

this.store.findAll('session');

The adapter and model are really really basic:

var SessionAdapter = DS.LSAdapter.extend({
    namespace: 'session'       
});

var Session = DS.Model.extend({
    name: DS.attr('string')
});
Error: Assertion Failed: TypeError: Invalid fullName: `model:@each`, must be of the form `type:name` 

If I "hardcode" the model into the results, the error goes away. I'm sadly unable to fix myself, sorry! I have tried :) PhantomJS not working either, just as an FYI.

https://github.com/kurko/ember-localstorage-adapter/blob/master/localstorage_adapter.js#L219

findAll: function (store, type) {
      var namespace = this._namespaceForType(type),
          results = [];
      for (var id in namespace.records) {
        results.push(Ember.copy(namespace.records[id]));
      }
      results = {"session": results}; //Resolver in Ember-CLI is perhaps causing trouble?
      return Ember.RSVP.resolve(results);
    },

Full Stack Trace.

__exports__.default<.resolve@http://local.test.com/dist/assets/vendor.js:16812:1
resolve@http://local.test.com/dist/assets/vendor.js:16434:16
resolve@http://local.test.com/dist/assets/vendor.js:14970:22
Container.prototype.resolve@http://local.test.com/dist/assets/vendor.js:14550:16
factoryFor@http://local.test.com/dist/assets/vendor.js:15053:21
Container.prototype.lookupFactory@http://local.test.com/dist/assets/vendor.js:14657:16
ember$data$lib$system$store$$Store<.modelFactoryFor@http://local.test.com/dist/assets/vendor.js:73164:16
ember$data$lib$serializers$rest_serializer$$RESTSerializer<.extractArray@http://local.test.com/dist/assets/vendor.js:67267:16
apply@http://local.test.com/dist/assets/vendor.js:32889:1
superWrapper@http://local.test.com/dist/assets/vendor.js:32459:15
apply@http://local.test.com/dist/assets/vendor.js:32889:1
superFunction@http://local.test.com/dist/assets/vendor.js:29317:15
AppSerializer<.extractArray@http://local.test.com/dist/assets/test-app.js:5109:1
apply@http://local.test.com/dist/assets/vendor.js:32891:1
superWrapper@http://local.test.com/dist/assets/vendor.js:32459:15
ember$data$lib$serializers$json_serializer$$default<.extractFindAll@http://local.test.com/dist/assets/vendor.js:66503:16
ember$data$lib$serializers$json_serializer$$default<.extract@http://local.test.com/dist/assets/vendor.js:66486:16
ember$data$lib$system$store$$_findAll/</<@http://local.test.com/dist/assets/vendor.js:73774:25
Backburner.prototype.run@http://local.test.com/dist/assets/vendor.js:13400:20
ember$data$lib$system$store$$_adapterRun@http://local.test.com/dist/assets/vendor.js:73661:14
ember$data$lib$system$store$$_findAll/<@http://local.test.com/dist/assets/vendor.js:73773:9
tryCatch@http://local.test.com/dist/assets/vendor.js:60521:16
invokeCallback@http://local.test.com/dist/assets/vendor.js:60533:17
publish@http://local.test.com/dist/assets/vendor.js:60504:11
@http://local.test.com/dist/assets/vendor.js:42649:9
DeferredActionQueues.prototype.invoke@http://local.test.com/dist/assets/vendor.js:13893:11
DeferredActionQueues.prototype.flush@http://local.test.com/dist/assets/vendor.js:13963:15
Backburner.prototype.end@http://local.test.com/dist/assets/vendor.js:13349:11
Backburner.prototype.run@http://local.test.com/dist/assets/vendor.js:13404:15
executeTimers@http://local.test.com/dist/assets/vendor.js:13769:7
updateLaterTimer/backburner._laterTimer<@http://local.test.com/dist/assets/vendor.js:13758:11

http://local.test.com/dist/assets/vendor.js
Line 28587
@kurko
Copy link
Collaborator

kurko commented Feb 24, 2015

Any chance you could get an ember-cli app that I could download and see the error by myself? I can't imagine what's going on just with the info above.

@Goldcap
Copy link
Author

Goldcap commented Feb 24, 2015

Hey, yes and thanks for taking a look. I've gotten a lot of mileage out of this adapter, and I just couldn't sleuth the problem myself: Public repo, including node and bower components, just for reproduction of the issue.

https://github.com/Goldcap/local-storage-test/tree/master/paom-app

Use the following URL to see the page in question:

http://127.0.0.1:4200/ember/product/new-product

@locks locks added the bug label Oct 5, 2015
@VincentMolinie
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants