ember-cli-mirage: Maximum call stack exceeded
I have the following model relationship defined, including their inverse counterpart:
product – hasMany --> product-association – hasMany --> product
This is how the database is seeded in one of my tests:
let associatedProducts = server.createList('product', 4);
let association = server.create('product-association', {
associatedObjects: associatedProducts
});
let product = server.create('product', {
associations: [association]
});
On the last create statement for product I get an “Maximum call stack exceeded” exception. Judging from the call stack the _setupRelationships method is called with infinite recursion. At some point it is called again for the product itself that is just to be created and which started this chain.
Interestingly this happened after upgrading from 0.2.0-beta.8 to 0.2.4, so it was working very well with the prerelease version!
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19 (11 by maintainers)
@mariogintili I would avoid recursive and many-to-many relationships for now. I have them working in a new branch but there’s still more work to be done before we can start testing it out.