-
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
[.cache] Deleted file still shown in gatsby posts #2410
Comments
Could you test if deleting a file works? Perhaps this code here doesn't work when a folder is deleted not a file?
|
Still looking into this. Not stale! |
Did this PR fix things for you? #2546 |
Also having a similar issue. I modified my |
Updated to latest version 👍 |
To delete your .cache folder just, cd into your project folder and run this in shell:
To rebuild cache just run |
seems like it would help to have this as an arg to pass in, kind of like how docker does it:
|
It could also be helpful to have a |
Creating then deleting caches makes the cache (more than) useless — instead — we need everyone to pitch in helping identify when and where our cache can get invalid. Our cache is already very good and can be perfect. We've merged ~10 PRs over the past 4-5 months fixing up edge cases in handling data in the cache e.g. this recent one #4209 This particular issue was fixed a while ago actually so closing it now. A general plea — if you ever run across a situation where you think the cache is at fault — please spend a bit of time verifying this it is a cache problem by verifying the problem and then create an issue with how to reproduce the problem, preferably with a sample site I or others could look at. Caches are amazing and provide incredible speedups and improvements to the DX. Totally understand how annoying a cache is though if you don't feel you can trust it — but I've spent 100s of hours already on the cache and am perfectly willing to spend that much more to make it perfect. But need people's help to identify bugs so they can get fixed. |
not having an official way to clean the cache until it's working well doesn't help the issue |
An official way to clear the cache is a strong indication that the project doesn't care about making the cache good which is absolutely not the case. You should never clear the cache. Again, if you ever feel the need to clear the cache, please file an issue. |
I'd love a way to reset the cache right now because I just switched one JPEG file for another with the same name, but for whatever reason, Gatsby doesn't see that the file has changed, and keeps showing the old image. It's driving me nuts because I can't figure out how to make it re-read the updated image file. |
@timojaask where is the jpeg image being used? Is it referenced from a markdown file or are you querying it with graphql and ImageSharp? |
@KyleAMathews I've got a graphql query with a lot of images, below is a snippet. So I changed the
I noticed that if I change anything in the basbas5 query, it will show the updated image. For example, if I change cropFocus to NORTH, it works. If I change it back to CENTER, it will show the old image again. |
Huh, that's odd. Lemme look into that real quick. |
I didn't make it far with my investigation but this is definitely a bug — we shouldn't be caching any query results if the underlying data changes in some ways. We normally don't I believe so not entirely sure what's happening. I'd appreciate more people investigating. |
Yes, I am storing markdown files, then deleting them, however the blog post rendered from the markdown file still persists on the webpage. Deleting .cache fixes this. |
@KyleAMathews I too found the same issue with the images as @timojaask . In my case (fetching from Wordpress API), if I change an image on there, it seems the GraphQL isn't picking that up and still uses the old one, in both development and production (I suspect cache) as I build and deploy with Am I doing something wrong or is that just plan weird? The same happens with local images. |
@filipetedim are you restarting |
@KyleAMathews yep. Restarting |
Same issue here. Trying to do another query using gatsby-source-strapi plugin, and neither the new fields that I created on Strapi, appeared. I already erased the .cache folder, browser cache, and whatever related to it, and nothing happens. The fields that I created aren't appearing. Error:
Query:
The new field is Landing_Owner, and the return:
And, the data was previously created in Strapi database. Someone could help? Thanks! |
@alexandresgf One simple way to make sure the cache is fresh is to rm -rf the entire project and re-clone it from git 😉 Make sure to push all changes before deleting! Works every time! |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub issues, we have to clean some of the old issues as many of them have already been resolved with the latest updates. Please make sure to update to the latest Gatsby version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 |
I had the same problem as @timojaask. I am using the latest version of GatsbyJS. Resolved the issue by adding a suffix to my jpeg filename. |
Having the same problem using source plugins, I have to delete the .cache folder after adding or removing any nodes for them to show up correctly. |
This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue. |
Have a similar problem with svg files - I get the "info changed file at ...../file.svg but the actual webpage doesn't refresh - I have to stop |
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! |
Wait what? |
Well... that's not right. |
Sounds like some cachebusting might be the solution / workaround in general (hashes in generated file names and references). |
I'm closing this issue, we fixed the problem described in this issue. When removing a md file, the listing gets removed but the html will still be accessible, which is described by #10844. If it's still an issue please open up a new issue. |
I replaced an image with another that had the same name. Gatbsy kept showing the old one, even after removing the cache. I had to rename my image to make the change happen. |
this happens to me all the time with gatsby. really annoying. takes like an hour of just messing around and RANDOMLY it works again.. happening to me right now. deleting cache sometimes helps. deleting node modules. npm install again. really a bunch of stuff... to all the people saying to never delete caches. good luck using gatsby without having to do that 8-9 times each project. i love gatsby but this kind of random unexplained error stuff happens way too often |
solution this time: copy and paste the text from markdown. copy images. delete it. delete cache. delete node modules. run npm. run build. THEN make a new markdown file and paste it all in yes... this is why gatsby is ridiculous |
I deleted a folder full of markdown in my
src/pages
directory but when I went to view my site (in dev) the folder was still being referenced. When I did a build the pages were still being referenced.I did a grep search but nothing was found. I started wondering if some data was being save locally and I was correct. The
.cache
folder still had.json
referencing the missing files as well as some file that I had updated to fix a typo (and the typo was still showing in development mode).The fix was to delete the
.cache
folder. The real problem however is that the updates to the filesystem are not shown in gatsby in realtime which can cause discrepancies. What exactly can you tell us about this interesting bug?The text was updated successfully, but these errors were encountered: