"Maximum call stack size exceeded" on circular-references
See original GitHub issue- Node Version:
v8.0.0
- Npm Version:
v5.4.2
- Platform:
Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64
(its a macbook pro on osx 10.13) - Package Version:
v5.0.1
Our contentpull package (https://github.com/remedyhealth/contentpull) wraps this package to simplify some of our conventional queries. We were alerted that our tests were failing when upgrading to your latest (v5.0.1
).
It was discovered after using this package on its own that our test data was failing due to a maximum call stack issue (as seen below)
RangeError: Maximum call stack size exceeded
at memoized (node_modules/contentful/dist/webpack:/node_modules/lodash/memoize.js:54:1)
at Object.get (node_modules/contentful/dist/webpack:/mixins/link-getters.js:61:20)
at node_modules/contentful/dist/webpack:/mixins/link-getters.js:42:21
...
Our failure is a circular referential test. While this is a bit odd we do have this circumstance in production (related categories reference each other).
Our test is simply to make sure those references work (which worked fine in previous versions):
it('should be able to parse a circularly referenced object', () => {
return client.getEntries({'sys.id': entryId}).then(entries => {
let nested = entries.items[0].fields.ref.fieds.ref.fields.ref.fields.ref.fields.ref // you get the idea...
nested.sys.id.should.equal(entryId)
})
Our test data is a single reference to itself on the field ref
. Below you will find the sample data:
{
sys: {
space: {
sys: {
type: 'Link',
linkType: 'Space',
id: 'space1'
}
},
id: 'entry1',
type: 'Entry',
createdAt: '2016-04-06T15:43:38.945Z',
updatedAt: '2016-06-08T14:52:24.824Z',
revision: 4,
contentType: {
sys: {
type: 'Link',
linkType: 'ContentType',
id: 'contentType1'
}
},
locale: 'en-US'
},
fields: {
title: 'TestEntry',
ref: {
sys: {
type: 'Link',
linkType: 'Entry',
id: 'entry1'
}
}
}
}
Please let us know if there is anything else we can assist with in resolving this issue.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:18 (8 by maintainers)
Thanks @axe312ger! I can confirm installing this locally resolved our maximum call stack issue!
Thanks so much and we will be looking forward to the next official release of this!
@matthew-contentful @TimBeyer I guess you should consider reopening this as people seem to still run into this issue