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

Error 'TypeError: Cannot read property 'type' of undefined' in 1.2.2 version #38

Open
ppietruszewski opened this issue Jul 29, 2020 · 3 comments

Comments

@ppietruszewski
Copy link

Hello
I've tried upgrade contentful-resolve-response from version 1.1.4 to 1.2.2 and I get an error in console: TypeError: Cannot read property 'type' of undefined
I get response from contentful like that:
{ "sys": { "type": "Array" }, "total": 1, "skip": 0, "limit": 100, "items": [ { "fields": { "internalTitle": "Page", "slug": "b", "title": "B", "description": "test", "metaTitle": "B", "metaDescription": "" } } ] }
I think the problem is in lines:
https://github.com/contentful/contentful-resolve-response/blob/master/index.js#L120
and
https://github.com/contentful/contentful-resolve-response/blob/master/index.js#L122
My response responseClone.items doesn't have sys key so it will be undefined.
Can you check it?
In old version, everything works perfectly.

@epbarger
Copy link

epbarger commented Oct 5, 2020

I also experience this issue after upgrading, in IE11 only. Previously this package worked fine in IE. Would love to see this resolved!

@eagleera
Copy link

I'm also having this issue when doing a select query on the CDA

@janro1
Copy link

janro1 commented Jun 9, 2022

is this package/code still used? 2 years and the issue is still open, not even a comment?

btw, this additional filter fixes it for me:

    allEntries.filter(entity => !!entity.sys).map(entity => {
      return [makeLookupKey(entity.sys), entity];
    })

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

No branches or pull requests

4 participants