-
Notifications
You must be signed in to change notification settings - Fork 110
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
Embedded content breaks Gatsby hot reloading #94
Comments
gatsby develop
on second load
Hey @thompsonsj, |
Hey @thompsonsj, |
@Khaledgarbaya any status updates on the progress of getting this fixed? This is pretty impactful to all Gatsby users and RichText users, but especially in a Gatsby Cloud context, as well. It breaks hot-reloading and user's applications. If it's helpful, I've put together a reproduction. I'm happy to hand over access to my Contentful instance (and provide access tokens) but here's how it breaks:
The why is that the json body that is returned only has a subset of data that's required, as we're well aware. |
Hey @DSchau we currently discussing whether we change the way the source plugin is pulling content from contentful, instead of progressive sync we always do an initial sync. |
I started a WIP PR to fix the issue and explained more what is happening. |
Oh thank goodness this is being addressed. We are concerned that a full sync of our content will slow down our build and Gatsby Preview processes as time goes on and there's more content in Contentful (we are ramping up quickly). The only workaround we have now is to configure gatsby-source-contentful with |
@Khaledgarbaya @DSchau Any update on this? |
Hi @KnisterPeter -- please check out @Khaledgarbaya's reply here: gatsbyjs/gatsby#15084 (comment) |
If any custom renderers are defined for the Contentful rich text type,
gatsby develop
breaks unless the.cache
folder is cleared before runninggatsby develop
again. If.cache
is not cleared, the GraphQL query stops returningfields
.In other words,
gatsby develop
loses references to embedded content on refreshIn my case, I am using @contentful/rich-text-react-renderer to render content, but I believe this may be an issue with https://github.com/contentful/rich-text in general.
Why its important
Defining custom renderers is the only way to render embedded assets and blocks.
For example, if you embed an image in a rich text field, you'll need to define a custom renderer to display it. This is intentional - Contentful does not hold any opinions over how content should be rendered. See #61 (comment).
This behaviour is reasonable. For example, Contentful would have no idea how to render an embedded content type.
If
gatsby develop
is unable to reference embedded content on refresh:Related issues
This is not a new issue, but related issues have either diverged or been closed without resolution.
This issue was identified in #46 for
gatsby-transformer-contentful-richtext
, but was closed without resolution due to the plugin being deprecated. However, as identifed here, the issue carries forward into @contentful/rich-text-react-renderer and likely @contentful/rich-text.Related to #46, this same issue was created in the Gatsby repo: gatsbyjs/gatsby#10592. However, that issue morphed into a talking about running out of memory, and the issue was closed as having resolved the memory issue. For reference, the memory issue is defined in #53.
The
.cache
workaround is mentioned multiple times:--
Thanks to @sarahbethfederman and @polarathene for working so hard on the issue up to this point.
@Khaledgarbaya, is this something that can be looked at? #46 (comment) suggests this behaviour is intentional, but this issue breaks hot reloading and Gatsby Preview.
The text was updated successfully, but these errors were encountered: