-
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
Error: The result of this StaticQuery could not be fetched. #24902
Comments
Can you share more information about how you're using StaticQuery? Please provide a minimal reproduction. |
Same error on multiple Gatsby projects after updating packages. Just created a new gatsby-starter-default to test what could be going wrong and ran gatsby develop with no error. After updating the following packages (all default, no new packages added), same StaticQuery error hits this new project. Updated packages on the new project: gatsby ^2.22.15 → ^2.23.3 Now downgrading one by one to narrow down the cause. |
I also updated packages and started getting this error. |
I got 2.23.3 working after verifying 2.23.0, 2.23.1 & 2.23.2. Here are the steps I took:
Then I updated each of the other outdated packages without error. |
Think u
Le mer. 10 juin 2020 à 21:46, Geoff Carr <notifications@github.com> a
écrit :
… I also updated packages and started getting this error.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#24902 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AO2LQYL7ITE7XMCHRBMSI23RV7WLDANCNFSM4N2IKZSQ>
.
|
Thanks, I just deleted my |
Same problem. It seems to happen as soon as a plugin is installed How to reproduce:
VersionsPackage.json
NodeJS
OSMacOS Catalina 10.15.5 (updated this week, already had some troubles with |
I also confirm both the issue and the fix by deleting My repro scenario:
So, to fix this I need to remove |
Facing the same issue, the above solutions didn't seem to work though. |
Same happened to me, removing node_modules solved it. |
Thanks! Had the same issue after the latest update, and your solution worked as a charm for me. |
This is a duplicate of #24890 If you're encountering this issue locally, remove the The reason is a falsy |
A duplicate of itself? |
The problems comes with Google Chrome. With Firefox, its running fine. I am not sure what could be the problem. I tried clearing browsers cache but didn't work! Now I'm stuck! |
* [Feature] Add game board. Now we can to start and restart game. I use mock data yet * [Feature][Modules] Add Ant Design for base stylization * [Bugfix][Environment] Hot reload works incorrectly after version 2.24.9 ( gatsbyjs/gatsby#26192 ) * [Bugfix] Stub for 'Error: The result of this StaticQuery could not be fetched' (gatsbyjs/gatsby#24902)
I'm facing this same issue now.
|
Ok solved after several attempts. Gatsby clean. Then remove all node_modules and reinstall. |
wtf I am only starting to use Gatsby for the second day and already had to do gatsby clean, remove all node_modules and reinstall 2 times and restart more than 5 times. This is crazy..... |
@nickgrealy Please refrain from using such images, as per our Code of Conduct we want to create an inclusive & safe space and posting such images can certainly trigger some people. |
@LekoArts - of course, deleted. |
I'm still having this issue. I've added deleting node_modules and running gatsby clean to my deploy pipeline but I still get this error intermittently. I'm using the latest version of gatsby |
I had the same issue again. But I figured out that I used useStaticQuery in a nested component file. The solutions I took are below. Problems
Solutions
See Gatsby's documentation 👉 Querying Data in Components using StaticQuery |
Same issue, this solution worked for me. 👍 Praise gastby clean! |
This turned out to be my issue too! Thank you! |
For me it seems to be caused by |
I'm having the same problem. Gatsby version: 3.7.1 The error occurs in:
The error doesn't appear:
Steps taken:
I'm not sure what I can do next. This is a huge issue for me as my client's site is now down. |
If you remove the offline plugin, make sure to add https://www.npmjs.com/package/gatsby-plugin-remove-serviceworker so users aren't getting stale SWs |
Thank you! This appears to have solved the immediate problem for me. |
For me the issue was a wrong import 🤦♂️
instead of the correct version:
After changing the import, the error got fixed 🎉 |
thank you it resolved my issue |
Thank you this fixed it ! .. my component name was Seo , and i was importing '/components/SEO' |
Error: The result of this StaticQuery could not be fetched. |
This happened to me too. As I'm using github actions to deploy, I ended up modifying my build script to:
On next deployment the error is gone. |
Hey, I am new to this but I have tried this - |
Currently experiencing this issue sporadically in production on a Gatsby 3.14.0 site using es6 hosted on Gatsby Cloud. I found one instance of an import with incorrect capitalization ( We're going to try the "Change file capitalization" hack soon to see if it resolves the issue. |
I encountered this error when deleting a ton of files /classes in my project. None of the steps above worked for me. I resolved this issue be adding back a Header class to the layout.js file that came with the template project that I was using. :/ |
@Montchat did you try |
I recently got this error while developing local. |
Still having this issue on the latest version of gatsby |
same issue with 5.3.2, but I'm able to workaround it by exporting query instead of using the hook import { graphql } from "gatsby"
export const query = graphql`
query { ... }
` |
I got a Static Query error in Gatsby v5.7.0 when using a query at slice component:
After some debugging noted that the "footer" component file was names with first capital case letter "Footer.js" but at createPages I have it resolving with lower case name "footer.js" and with ID also in lower case:
I changed this to properly match the component filename:
And referenced the slice with the ID reflecting the case sensitivity:
And this resolved the "StaticQuery could not be fetched" error. This problem occurred in MacOS so looks that how we are referencing the resolve / import filename affect when static query data is resolved from cache. The mentioned error above don't occurred when cache is cleared, only on the builds where cache exists. This may give some hints for the other cases of the bug that are reported in this thread. Thanks! |
Gather here. So the issue, for me in version 5 was inconsistent case in file name and imported module. Make sure these match. If you use upeercase in first letter of file name be consistent inside file during exporting and importing. Hope it helps someone! |
This comment helped me out a bit. Mine failed until I refactored the component-level call of useStaticQuery() into a hook that I imported and called within the function- following the example in the docs. https://www.gatsbyjs.com/docs/how-to/querying-data/use-static-query/ |
For me, the issue was a duplicate query name. I had shadowed a Header.Logo.jsx file from a react template to in order to modify it and it had a query from graphql in the file. You cannot have a duplicate query name in there that's the same as the original file, so renaming the query name in my shadowed file fixed the issue for me. |
It was very helpful for me! I make all quey name as MyQuery before and it made mistake 🥲 But when I changed query names for each other, it cleared! Thanks @SL4YT4NIC |
Error: The result of this StaticQuery could not be fetched.
This is likely a bug in Gatsby and if refreshing the page does not fix it, please open an issue in https://github.com/gatsbyjs/gatsby/issues
useStaticQuery
C:/Users/fadhl/Desktop/projects/Gatsby/.cache/gatsby-browser-entry.js:76
73 | if (context[query] && context[query].data) {
74 | return context[query].data
75 | } else {
The text was updated successfully, but these errors were encountered: