Using Ember v1.8 beta 3+ with Ember Data 1.0 beta 10- you receive this error:
Error while processing route: index Cannot read property 'async' of undefined TypeError: Cannot read property 'async' of undefined
at Relationship [as _super$constructor] (http://builds.emberjs.com/canary/ember-data.js:9523:46)
at new BelongsToRelationship (http://builds.emberjs.com/canary/ember-data.js:9736:12)
at createRelationshipFor (http://builds.emberjs.com/canary/ember-data.js:9840:16)
at http://builds.emberjs.com/canary/ember-data.js:6366:41
at http://builds.emberjs.com/canary/ember-data.js:9307:20
at cb (http://builds.emberjs.com/ember-latest.js:15907:13)
at OrderedSet.forEach (http://builds.emberjs.com/ember-latest.js:15703:13)
at Map.forEach (http://builds.emberjs.com/ember-latest.js:15911:19)
at Function.Model.reopenClass.eachRelationship (http://builds.emberjs.com/canary/ember-data.js:9306:42)
at Ember.Object.extend._setup (http://builds.emberjs.com/canary/ember-data.js:6365:26)
Despite your models being set up correctly:
App.Color = DS.Model.extend({
color: DS.attr(),
foo: DS.belongsTo('foo', {async:true})
});
App.Foo = DS.Model.extend({
foo: DS.attr()
});
Example: http://emberjs.jsbin.com/OxIDiVU/1111/edit
This is a bug with Ember/Ember-data versions. Ember changed its Map implementation in Ember 1.8 beta 3 breaking any version of Ember Data less than 1.0 beta 10.
Here's the github issue: https://github.com/emberjs/data/issues/2323
It's fixed in 1.0.0-beta.11+canary.2997e47034 or above.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With