-
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
localFile is crashing GraphQL queries (wordpress, ACF) #6273
Comments
Thanks for the detailed report @filipetedim. That does sound strange... Are you able to create a repo that demonstrates the problem? Alternatively maybe there's some useful info in #2492? |
I've already read all of #2492 before, no help there. I can't really set it up. It happens on my current repo but only randomly and on certain images as said. What, besides trying to create a repo, would be the best way to showcase it? |
Hey folks, I think myself and @dannywils have figured this out within the scope of our projects that are throwing this issue. Quick check to see if this solution will apply is to visit the REST endpoint for the specific media item that's not found (
The underlying (seemingly random) issue, was how the image was originally added to the WordPress media library. When an image is first uploaded, it receives a The quick and dirty fix is to update the |
@filipetedim did my solution above help you out at all? Are you still seeing an issue? |
Sorry I completely forgot to come back here as I have more projects at the company. I will check on next week (tomorrow day off) and I will come back but it does make sense! God damn nice finding |
I can confirm this same problem on my test site, and switching the post parent to 0 does indeed fix the issue. Although this does mean media items are no longer children of the current page. Which is probably ok in 99% of cases. Nice work on the debugging, that's a real subtle one. |
@m-allanson is there somewhere in the docs for "known issues" in case someone else runs into this? Or should I just put it in the source-wordpress readme? |
@Khristophor there is a troubleshooting section in the WordPress Source Plugin Readme. Probably best to go into there :) Is this something you would be interested in making a PR for? |
@crgeary sure, I'll get a PR open for it. |
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 just had this issue and my problem was in the |
Thank you @TN1ck, you solved my issue too! Please submit this PR, or I will 😉 |
Description
The localFile property in image queries under ACF from [gatsby-source-wordpress] just isn't there. What's weirder is that it's working for all other queries and images I have.
E.g. one query that works is the blog posts:
However, when querying the jobs:
Then I get the error:
What I have also found, is that the image is not anywhere to be found in the
.cache/gatsby-source-filestream
folder. I went through every single image file, and it's not there.More relevant information:
.cache
folder and nothing changed`I've read @KyleAMathews 's response somewhere about localFile:
Steps to reproduce
Not sure how to reproduce exactly.
I've only got this issue with one image from all of my wordpress, but the closest I can get to it is
Expected result
To receive the localFile, which means the image would have been locally cached.
Actual result
localFile property does not exist in query nor the image file exists in
.cache/gatsby-source-filesystem
.Environment
Using wordpress and gatsby with gatsby-source-wordpress, macOS.
The text was updated successfully, but these errors were encountered: