gatsby-uc / gatsby-source-strapi

Gatsby source plugin for building websites using Strapi as a data source
MIT License
354 stars 182 forks source link

2.0.0-alpha.1 Error - TypeError: Cannot read properties of undefined (reading 'map') #278

Closed geoox closed 2 years ago

geoox commented 2 years ago

Hello,

I've seen the latest version of the npm package (and the default one) as of late became 2.0.0-alpha.1. After downloading the package, I get the following error:

image

I know @soupette is still working on the PR regarding the compatibility with Gatsby v4 & Strapi v4. I wanted to flag out the fact that the latest alpha release has this error and ask whether we could have a timeline of when the migration might be completed - we are on the verge of using the gatsby graphql plugin, but we would love to make use of this library instead if the ETA is rather close.

Thank you!

remidej commented 2 years ago

Hello and thank you for pointing this out. The 2.0.0 shouldn't have been the "latest" on npm, but that's fixed now.

Regarding your error, can you confirm you're using Strapi v4?

Also, at this point I'd strongly recommend to keep using gatsby-source-strapi. The ETA is close, and once released this version will make many things easier, like working with optimized images for example.

geoox commented 2 years ago

Yes, using Strapi v4.0.7 and Gatsby v4.7.1

geoox commented 2 years ago

LE: after checking out the latest readme file I have found out I need to create an API token and add it to gatsby config. After adding it, the issue is gone and I can find my collection types (using v2.0.0 alpha 1)

Keep up the good work, can't wait for the release of the updated package.