I am trying to get the data using store as: this.store.findRecord(‘modelName’, id, { reload: true }).then(…lamda func), but getting error. This is in ember version 5.8 and my model is in older version before octane. Has anybody got any idea, why is this issue existing.
most likely you have a hasMany relationship with null
in it e.g.
{
relationships: {
friends: { data: [null] }
}
}
Guessing you need to specify an inverse on your relationship definition.
e.g. if your model is book
and the hasMany is pages
- @hasMany('pages') pages;
+ @hasMany('pages', { inverse: 'book' }) pages;
or, if you don’t have or want an inverse relationpship:
- @hasMany('pages')
+ @hasMany('pages', { inverse: null }) pages