-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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] Gatsby unaware of change in Contentful unless delete cache folder #3495
Comments
Sorry you're running into troubles and thanks for creating a detailed bug report! A cache that you delete all the time isn't very helpful :-) This sounds like a bug perhaps in gatsby-source-contentful where it's not correctly incrementally updating data in Gatsby so Gatsby can't correctly make the new schema. |
I'd love to dig deeper in the package code when I have time to see if there's anything suspicious. Deleting the cache is not desirable for me also. But for now, it's a temporary solution. The point is we're planning to use Contentful webhook to tell Gastby to automatically rebuild on new content, so that my non-tech teammate can push new content on their own. So yeah, having to manually delete the cache kinda defeat the purpose. Thanks for quick response and for Gatsby! |
Running into this today as well. Removing Scenario:
In the example here, we have a Full error output
|
Hmmm Gatsby should be creating a Union Type when there's multiple types being linked to:
Perhaps something is wrong with the reference maps gatsby-source-contentful creates
|
@KyleAMathews I think I find out what went wrong. I'm super new to the project and how it actually works under the hood, so I might be wrong though. So please bear with me.
(Sorry for typos and wrong use of words. Not a native speaker, but I'm trying to communicate better) |
Cool! What you're suggesting sounds reasonable — would you like to put together a PR with your fixes? |
@KyleAMathews I'd love to. It might take some time though cause I'm still kinda new to JS. In the meantime, if anyone need to fix this issue asap, please feel free to pick it up. |
Running into a similar issue. I delete my |
Sorry, I've been quite busy lately and this issue was on low priority for our own project. Gonna put together a fix in the next few days. |
Great, thanks for tackling this!
…On Sat, Feb 3, 2018 at 10:30 PM, Harris Nguyen ***@***.***> wrote:
Sorry, I've been quite busy lately and this issue was on low priority for
our own project. Gonna put together a fix in the next few days.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3495 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEL3W66L9SUV9XTsUIv2oLxTfNwtKkaoks5tRU6NgaJpZM4Rb4OQ>
.
|
How's the fix coming along @harrisnguyen94 ? I've ran into the same issue and would be interested to hear how close we are to fixing this |
@alex-saunders hi, updating the reverse mapping for existing nodes (which solve issue 1 is simple and pretty much done. Issue 2 needs some thoughts though, but we have located what went wrong and kinda figure out how to fix it. It was Lunar New Year so I was off for the last 2 weeks. Sorry for the delay. Looking forward to seeing these problems solved asap. |
Hi @harrisnguyen94 , no worries about the delay, sounds like it's pretty much there anyway! I'm only really needing (1) so happy to hear that the fix should be coming asap. |
@alex-saunders Hi, I need to confirm this. Are you by any chance also using multiple locales on the Contentful side? This info would help me deal with a new found problem. |
Hi all. Same issue here but in my case deleting ".cache" doesn't solve it (i.e., moving a content from published to draft) |
@rubengarciam Hmmm. So the contents moved to Draft still show up? Normally deleting the cache should force Gatsby to fetch fresh data. Could you please do a quick test? After moving content to draft, slightly edit that content, and see if the status change is reflected correctly. |
Test 1 - post still showing up
Test 2 - post still showing up
Test 3 - post still showing up and edit is reflected
Test 4 - post still showing up and edit is reflected
@harrisnguyen94 So it seems it's fetching the updates to the content correctly, no matter if it has been moved to draft or it's still published. Once the item has been published for the first time looks like any status change is not reflected anymore (unless archived) |
Hmmm. That's new. Thanks for the info @rubengarciam. Just one more thing. Make sure you're using the Content Delivery API instead of Preview API. Other than that, I'll give it a check. I remember hitting a rock last time and almost forget about this. |
Yup, all that config is ok. Looking forward to the update! Thanks |
@Khaledgarbaya mentioned there's a contentful api to get all entities that reference a now deleted entity — anyone want to add support for that? (Or I think we can just iterate through Contentful nodes locally and remove references from there which should be faster than hitting the external API) #3054 (comment) |
I think iteration is the way to go. Because we also have problem with removed field still showing up, not just reference. With fresh I'm afraid I cannot tackle |
Having exactly the same issue here. |
I believe I am running into the same issue, I have to delete the cache for related links to appear in |
I'm having a weird issue that might be related where sometimes all my posts fail to load from Contentful. They do show up in GraphiQL but equal |
Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help! |
I'm still having this issue, did anyone figure it out? Publishing edited content on contentful doesn't update locally when running |
No this is not possible, as Contentful somehow would need to contact your local dev environment via web hook. |
I am also experiencing this issue. Gatsby uses the old data even when I make changes in contentful. I am stuck on the project I am |
I see possible mistakes you do:
Hope that helps |
The changes are shown in the graphql query but not used in the component. Thanks for the suggestions. |
I had to do Gatsby clean for changes to reflect. |
Exporting Usually works for me without cleaning/restarting the dev server. |
Hi, I'm facing a lot of issues that relate directly to the cache folder.
Description
Gatsby would not aware if I publish a new Brand, and the Category page remain the same. If I query for brand directly instead in brand template, the brand page is generated successfully. When I delete the cache folder, and run again, all query and pages work as expected.
If I add a new field to content type Category (that Brand link to) and is queried as above, then run gatsby develop, I would get the error
unknown field brand in contentfulCategory
. (query for brand from Category also won't work in Graphiql IDE). Again, manually delete the cache folder and run again solve the problem.When I delete a field successfully in Contentful, that field will still be queryable in Gatsby. Delete cache folder also solve this.
Step to reproduce
gatsby develop
, it compiles successfullygastby develop
, and see the resultEnvironment
Gatsby version: 1.9.145
Node.js version: 6.9.1
Operating System: Windows 6.1.7601
More Info
I'm using
gatsby-plugin-react-next
.Before I found out deleting the cache folder help with the issues. Running
gatsby develop
multiple times would occasionally solve the problem.Edit: It worked because I had some change in gatsby-node.js, which triggers the deletion of cache folder.
Request
Also, it would be great if there's a way to tell Gatsby to completely delete the cache folder on new build in the meantime. I didn't find anything in the documentation. Appreciate if you can show me the direction.
The text was updated successfully, but these errors were encountered: