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
gatsby-source-contentful rich text embedded entries are not resolved #10592
Comments
Not sure if related to #9821 |
I'm not sure just how much support we have for RichText field types ATM. As far as I know this field type is still in beta. (?) I know @Khaledgarbaya did initial work on support for that. Maybe we "just" use too old version of contentful SDK (
|
I'll try to setup our example ( https://github.com/gatsbyjs/gatsby/tree/master/examples/using-contentful ) to use that feature so it's easier to reproduce for anyone who want to look into it - just need to figure out what "embedded entries" actually are |
Hey Folks, The link resolution won't be possible on subsequent sync because there is no enough data available for the sdk to resolve it. |
@Khaledgarbaya would it be better to cache the data locally as a JSON file for Rich Text nodes? I've just added support to the plugin with a PR for downloading contentful assets and providing a field that can be queried in graphql to get local file links instead of the contentful urls. At least my understanding is there is some problem with how it's caching the data atm? I've not tried with any embedded entries or messing with {
contentfulPageService {
title
description { childContentfulRichText { html } }
}
} Is the cache issue with sync token specific to the nodes internal content only? Or the way it's being queried by @pieh ? |
Just throwing this out there...is there a way to possibly use the contentful sync API to update the content? https://www.contentful.com/developers/docs/concepts/sync/ |
Fwiw, updating from gatsby 2.0.83 to 2.0.90 breaks the resolution sometimes even on gatsby build, which previously worked (gatsby develop is the problem) |
Also it turns out that nested embedded entries (embedded entries that include an embedded entry) are not resolved either. |
Hey @sarahbethfederman, |
I can't do that as it's an internal project and can't publish the keys or code. Have you tried reproducing with nested embedded entries? |
@sarahbethfederman you're not able to make a similar reproduction repo? Your issue can be generalized out of it's current context with the internal project right? using-contentful example might be of use to you? You can register a personal account with Contentful(assuming the one you're using atm is related to business/work), setup a free space that demonstrates the problem well, then once sorted, delete the space and reproduction repo if you like? @Khaledgarbaya can probably provide you with a space failing that. |
Huh weird. Nested embedded entries seem to have started working again |
@sarahbethfederman, |
It would be good to have an example of it in the documentation. I've not played with rich text much myself, but it sounds like there are currently gotcha's to using or understanding how to use it properly with gatsby/react, so it'd probably be really helpful to others that run into the same situation? |
Removing the |
This issue is absolutely not fixed. Gatsby develop is still completely unusable and I can't delete my cache. |
@sarahbethfederman Why is that? If this is still an issue, providing a small reproduction repo for others to use can help with collaboration. |
I can't delete my cache because it breaks with another error contentful/rich-text#46 (comment) This is my last day on the project so I can't make another repo but other people are having this issue too. To be clear: gatsby develop has never resolved the entries properly. Gatsby build used to resolve all entries properly, but as I said in my above comment it broke when upgrading gatsby (the first few entries don't resolve), and I experienced an issue where nested embedded entries (embedded entries that include another embedded entry) didn't resolve. The nested embedded entries are now resolving. Not being able to use gatsby develop is still a huge issue and not being able to update gatsby is still an issue |
I put together a github repo that I think demonstrates this issue. I created a dummy contentful account, so both the space id and access token are in gatsby-config.js as plaintext. When retrieving 'blogPosts' and accessing its 'body' rich text field, assets within have content field values of empty arrays. This url should open up the graphiql query automatically. Let me know if I can be more helpful. I'm not as deep into this as everyone else but I would also like to find a solution. I don't know otherwise how to get images in my blog posts. |
We're having a similar issue with Contentful Rich Text fields, although the issue is that nested embeds can be recursively linked to other embeds, ad infinitum. On running |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
Hello there, I am Contentful's product manager working on our Rich Text editor and we recently released an improvement in the Thank you and let me know if that works. |
Hello there, I am Contentful's product manager working on our Rich Text editor and we recently released an improvement in the I know that I've posted the same message in all your other issues too @sarahbethfederman but I hope other people who were having the same issue also benefit from this. Sorry for the spam! |
Hey again! It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m Thanks again for being part of the Gatsby community! |
HIi, I have just linked to an entry in a RIch text field, and instead of a url to the entry I can type: entry-hyperlink id: XXXXXXXXXXXXXXX (with the actuall id that is) display on the front end. Why doesn't it automatically link to the resources / asset by displaying a url? |
@pieh I did some digging and found a way to consistently reproduce this:
The problem is something with the sync in the contentful SDK. If I disable incremental sync (by manually setting the sync-token used to Side note: Updating to the latest contentful SDK version 7.x did not help. A quick workaround would be to allow to configure |
For anyone coming here looking for a solution on how to get data all the time (not just on the first go), the above PR adds a handy option you can pass to your config. {
resolve: "gatsby-source-contentful",
options: {
forceFullSync: true
}
} https://www.gatsbyjs.org/packages/gatsby-source-contentful/#configuration-options 👨💻 |
UPDATE: Nevermind. :) I just found your doc that explains this: https://www.contentful.com/developers/docs/tutorials/general/rich-text-and-gatsby/. it seems like in this case I want |
Was there a solution found for this? We cannot get INLINE or BLOCK.EMBEDDED_ENTRY instances to maintain their data in development/preview. The This issue is not present with BLOCKS.EMBEDDED_ASSET. I'm reluctant to use forceFullSync because it seems there would be considerable performance issues with fully syncing every change in preview. |
Thanks to @coreyward and @daydream05 for digging this up. This issue should now be solved with the new canary version of Please check the install & migration instructions at #25249 I'd love to hear if this fixes your issues. The new way to render Rich Text should give you full flexibility and resolve data properly. |
I am having the same issue yet. Its not solved for sure. when I use |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
@devpatelwebdeveloper you have to install the new canary version of the plugin, probably also clean gatsby cache to get the se fields. See #25249 on how to install & migrate your code |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Closing here, lets continue further discussion in #25249 |
Description
I've been working on using the rich text fields in gatsby and it seems that embedded entries are supposed to be resolved since this plugin uses the contentful SDK, but all I see is the id of the entry its supposed to resolve to.
Steps to reproduce
More info on what i've been doing here: contentful/rich-text#46
Expected result
The JSON should have access to all fields of the entry. So for a link I should have things like the slug and title of the entry its linking to.
Actual result
I can only see the target.sys.id. Here's an example of the JSON string returned:
Environment
The text was updated successfully, but these errors were encountered: