Open Nicholas-Westby opened 2 years ago
for anyone that comes here again, this is the right query to handle images, but the error happens if you don't have any post in contentful with an embedded asset. try adding an image as an embedded asset in any of your post and see if the error goes away
Yesterday (August 3rd, 2022), I created a Contentful account and cloned this repo. I ran
npm i
,npm run setup
, andnpm run dev
. That last command led to this output:The main error of interest here is:
Note that I logged into Contentful and verified it seemed to create all the content types and content nodes fine.
I am thinking the error is related to this bit of code in
blog-post.js
:The part that mentions "references". I am not super familiar with Gatsby/GraphQL/Contentful, so not sure exactly what the issue/fix is, but it seems like it's probably related to the code mentioned above.
That
references
block of code seems to have been added a few days ago in this commit: https://github.com/contentful/starter-gatsby-blog/commit/863c04860913db4c6b6832815e2708dd6bb6245a ("Adding inline images to body of blog post")EDIT: If I remove the following:
Then it seems to work fine. I imagine there was some purpose for that though, so unsure of the implications of removing it.