-
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
[bug]: ☂️ umbrella issue for cache and over-eager persistence issues #11747
Comments
I think I ran into this issue and after much frustration I started this issue but ended up closing it after deleting the public folder and getting everything to work. I do believe this sounds a lot like what others are experiencing though. |
I built my site off of the Netlify CMS starter, https://github.com/nickytonline/www.iamdeveloper.com. It has deleting the Not sure why, but they must have a good reason to delete the I remember when I started off with another starter site, I had to delete the |
Please bear in mind that I am not 100% sure this was the cause of the issue forcing me to delete the |
In working with several developers using GatsbyJS over the past 9 months I’ve only had this isssue come up once. A colleague was experiencing graphql errors because an API wasn’t being reached. We had recently changed how we fetch data (using gatsby-source-Wordpress) in Gatsby-config.js. When he updated his master branch, running the cli command “gatsby develop” still used the old settings. Deleting .cache solved the issue. |
I've been working with GatsbyJS last 6 months and I faced some issues when you update some local content (MDs and JSONs in our case) and it doesn't update. Actually, we've created the |
We updated our content types in contentful (removed some types, added some). Removing the cache folder made the dev server start up again. Cc @axhamre. |
We've run into an issue with contentful where, when we've added images via a rich-text, we've had to delete the For instance, we've added images, re-started the dev server, and were still unable to query image properties like
deleting the |
I abstracted a lot of functions utilized inside my |
Not sure if it counts... Recently, I had to press Clear cache and retry deploy button in Netlify's CI during this PR - that checks turned green only after cache clean. It started to fail with adding of |
Though it is undocumented it seems one can use Gatsby's cache object to set and get json objects. Data is stored in the In your plugin
|
@u12206050 correct! A bit out-of-scope for this discussion though, right? We'd love if you were able to rectify the "not documented" piece and document that API :) |
Oops, unpinned this accidentally. Sorry! (Perhaps GitHub should make repository actions more obvious 😛) |
This is a pretty systemic problem whenever adding a new image. Pretty much exclusively I have to |
Running into this issue again myself now, deleting the public folder and .cache folders don't seem to do the trick anymore. The images are there, I am willing to invite someone to the repository to check it out if you like but it seems that when working with static image files this happens a lot. They are present in the gh-pages branch but showing up broken on the deployed site. |
I figured out what was going on in the above case. I have a series of image files in a |
I wrote plugin gatsby-source-gh-readme to pull file content data from a user's github account, it does the job it should do but I need to clear the cache before running |
I'm running into trouble with I'm using
exports.createResolvers = ({ actions, cache, createNodeId, createResolvers, store, reporter }) => {
const { createNode } = actions;
createResolvers({
GCMS_Asset: {
file: {
type: `File`,
resolve(source, args, context, info) {
return createRemoteFileNode({
url: source.url,
store,
cache,
createNode,
createNodeId,
reporter,
});
},
},
},
});
}; When first starting query {
gcms {
assets(first: 1) {
url
file {
childImageSharp {
fluid {
src
originalName
}
}
}
}
}
} the second time I start
The file does exist:
The only thing that I do find odd, is that it's looking for the file Deleting the Edit: As a workaround I could add the |
Having this issue, and detailed my experience in this ticket: |
I think I have found that when using gatsby-background-image I have random .cache issues that are only on the client side when viewing the website, If I clear my local cach or turn off the local cache and then reload the pages, it will work fine after. Anyone have a similar issue? Has me scared to do webhook based rebuilds on my project, If I do, can I just run gatsby clean then gatsby build to guarantee a clean build? |
Let’s go ahead and close this for now since it’s been relatively quiet and people seem to have been hitting this less often than before. Please open independent issues with reproductions for cases where caching breaks your gatsby build so that we can action those! Thanks everyone! |
Unsure if this is an issue related solely to Gatsby, but I've had to use this command twice in the last two days. I am using the |
I'm fairly new to Gatsby and also had to implement a clean step to get it to pick up changes in page property values from Here's a log in case this helps:
Environment:
Also from package.json:
|
I've definitely observed strange behavior when I:
and I get a I noticed in a comment above that @keithmifsud thought that changing the property name in his JSON data from Does anyone know what might be going on in situations like this? My GraphQL query included a clause to another JSON file with an id property. Were they clashing somehow? Is there a list of reserved words that can't be used in JSON objects when inferring the schema? I spent hours, maybe days debugging this, and the fix is entirely unsatisfying.
|
This fixes the problem we started seeing recently when running `npm run start` more than once caused a Missing field GraphQL error, which resulted in the site failing to run and the GraphQL editor to show that the wikipedia.json file was no longer queryable. Running `npm run clean` would then allow things to work again. But this caused problems in environments when we wanted to keep the cache around for a faster build, and it was just annoying when developing the site. I tried a bunch of things but ran across an issue on GitHub where someone said that changing the name of a property from `identifier` to `name` in the JSON data they were querying made this problem go away. I didn't have an `identifier` property but I did have an `id` and thought changing it to `personId` might help. It did make the problem go away. I tried to document this on GitHub for Gatsby here: gatsbyjs/gatsby#11747 (comment) This was a difficult problem to debug, and the solution was really unsatisfying because I don't understand why it helped. I think if we are going to continue using Gatsby in the future we might want to invest some time learning how to define our schema rather than letting Gatsby infer it.
@edsu This is likely it. gatsby-transformer-json uses your id if you supply one but Node IDs must be universally unique as all nodes live in the same namespace — see https://www.gatsbyjs.com/docs/reference/config-files/actions/#createNode |
Ran into this issue today. I was setting up Gatsby with Contentful and wrote some dummy text in the Rich Text Field in Contentful to fetch through GraphQL. It was running smooth until I edited the rich text/embedded assets. It through this error:
and I ran |
Issue: Import error when using component shadowing in gatsby-theme with gatsby 5.2.0Description: I am experiencing an import error when working with component shadowing in a gatsby-theme that uses gatsby 5.2.0. Every time I make a change in the codebase, I get the following error: Attempted import error: '$virtual/async-requires' does not contain a default export (imported as 'asyncRequires'). The only way to resolve this error is to run Steps to reproduce:
Expected behavior: I expect the code to recompile and update the site without any errors. Actual behavior: I am getting the import error described above every time I make a change in the codebase. Environment:
Additional context: Has anyone else encountered this issue before? Is there a fix or workaround for this problem? I would really appreciate any help or guidance on how to resolve this issue. Thank you! |
This also happened to me when using a monorepo architecture with a "shared" package that my Gatsby site imported. What worked for me was to add |
Description
In this umbrella issue, I'd like to provide a means for others to share any issues encountered regarding caching, specifically in instances when the solution to a problem you were facing was remediated by removing the cache (e.g.
rm -rf .cache
).Issues that we have seen before (but generally have not been able to reproduce) can usually be classified as one of the following:
If any of these scenarios, or more broadly speaking, if you've ran into a problem where content wasn't appearing appropriately and deleting the cache solved this problem--then please chime in!
Intent
If we can reliably reproduce these types of issues and scenarios, we can harden our cache and improve the experience for all Gatsby users. Specifically, if we can reliably reproduce we can fix the underlying issue and then author end-to-end tests to ensure that the caching issue remains fixed.
Template
Please use the following template to report an issue so that we can most effectively debug the underlying issue.
Note: it is extremely important that you provide as much information as possible for the reproduction step. The more info and clearer the reproduction, the better we will be able to debug and ship fixes to these issues!
The text was updated successfully, but these errors were encountered: