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
Deleted Contentful post still present in local build #28
Comments
Have you tried deleting the cache folder? |
Thanks @brandonkal - that seems to have done the trick! I actually saw that as a potential fix for a similar issue on another project / rep, but a lot of people said it didn't work so I didn't bother trying it. That'll teach me... Any idea why this may have happened? Any thoughts on how to prevent this from happening? Wondering whether the cache can be deleted every time as part of the build process (or does this defeat the point of it in the first place?)... |
The cache is useful for preventing unnecessary API calls to Contentful as usually changing posts or just adding more posts if more common. If you do delete content that has been built, deleting the cache is a nice way to avoid these problems. |
OK thanks. You've provided a solution, but I guess the root cause of the issue still exists. In this instance, would you close this issue on GitHub or leave it open for further investigation? |
I would close the issue here as it is not related to the GCN starter project. This issue is related to the It looks like there is already an issue open for this, and you can add to the discussion here: gatsbyjs/gatsby#3495 |
Many thanks for the information and tips. 10/10 would GitHub again. |
First of all, fantastic job at putting this together Ryan. I'm new to pretty much everything involved here (React, Gatsby, Contenful, Netlify) but this project has helped me understand each of them.
I'm experiencing an issue where I've deleted one of the pre-existing posts ("Sailing Around The Bay") and it still shows in my local build. The live site is updated fine through Netlify.
I've run
gatsby develop
andgatsby build
multiple times to try and 'flush' the change, but it remains.To confirm, a graphQL query for posts on my local build brings back the following:
{ "data": { "allContentfulPost": { "edges": [ { "node": { "title": "Beach Day", "id": "c46W6F2LB9KK48AoKWGKQWy" } }, { "node": { "title": "A Walk In The Park", "id": "gaDq907enKa8UeKuAWOQG" } }, { "node": { "title": "Sailing Around The Bay", "id": "c2H1mrgshZeQki8UQ2yGq0s" } }, { "node": { "title": "Puppies!", "id": "c3wnBmHFsMg8KAOq2kagiks" } }, { "node": { "title": "Test Post", "id": "c3exNfAvwYg4IKK426sQS4S" } } ] } } }
If I run
gatsby build
then apublic/sailing-around-the-bay
folder is created with anindex.html
inside. As expected, if I open the local build then the home page displays the deleted blog post.If I run
gatsby develop
then the folder remains but theindex.html
disappears. If I open the development site on the localhost URL then the home page still displays the deleted blog post.Any ideas?
The text was updated successfully, but these errors were encountered: