Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Error in function useStaticQuery in ./.cache/gatsby-browser-entry.js #35

Closed
coelmay opened this issue May 8, 2021 · 8 comments
Closed

Comments

@coelmay
Copy link

coelmay commented May 8, 2021

Hi @brxck,

After running netlify dev and reloading the browser I get

One unhandled runtime error found in your files. See the list below to fix it:
Error in function useStaticQuery in ./.cache/gatsby-browser-entry.js:77
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

./.cache/gatsby-browser-entry.js:77

  75 |     return context[query].data
  76 |   } else {
> 77 |     throw new Error(
     |          ^
  78 |       `The result of this StaticQuery could not be fetched.\n\n` +
  79 |         `This is likely a bug in Gatsby and if refreshing the page does not fix it, ` +
  80 |         `please open an issue in https://github.com/gatsbyjs/gatsby/issues

It says it is a Gatsby issue, however as I do not know enough about either this starter or Gatsby generally, I thought I would post here first.

Screengrab of error message:
Screen Shot 2021-05-08 at 2 25 28 pm

@brxck
Copy link
Owner

brxck commented May 8, 2021

This isn't something I've encountered before, and unfortunately there's not a lot to go on here.

Deleting Gatsby's .cache/ can sometimes resolve Gatsby errors. I might also try removing node_modules/ and attempting a fresh npm install.

There looks to be discussion of this error in the Gatsby repo: gatsbyjs/gatsby#24902

Best of luck! Please let me know if more info turns up or if it turns out to be related to the starter.

@coelmay
Copy link
Author

coelmay commented May 8, 2021

Thanks @brxck
I did try deleting .cache without success. I shall read through thread you mentioned and let you know the result.

@coelmay
Copy link
Author

coelmay commented May 8, 2021

Followed the "fix" mentioned in gatsbyjs/gatsby#24902 (comment) and after a couple of hiccups, all seems working.

@coelmay coelmay closed this as completed May 8, 2021
@DOSputin
Copy link

DOSputin commented Jul 12, 2021

Followed the "fix" mentioned in gatsbyjs/gatsby#24902 (comment) and after a couple of hiccups, all seems working.

I'm having same issue.
That discussion you linked is a longwinded one.
I removed node_modules reinstalled and cleaned cache. No joy.
Would you mind detailing what hiccups were to get past this booger?

@coelmay
Copy link
Author

coelmay commented Jul 12, 2021

@DOSputin The comment I linked to is "the fix" I followed. What more do you need detailed?

@DOSputin
Copy link

DOSputin commented Jul 12, 2021

@DOSputin The comment I linked to is "the fix" I followed. What more do you need detailed?

Your comment seemed to elude to a few other steps that you took, a la; hiccups?

Followed the "fix" mentioned in [gatsbyjs/gatsby#24902 (comment)] and after a couple of hiccups, all seems working.

@coelmay
Copy link
Author

coelmay commented Jul 12, 2021

Your comment seemed to elude to a few other steps that you took, a la; hiccups?

Unfortunately I do not remember what those hiccups were.

@DOSputin
Copy link

been mashing on this for hours now. still can't get past this nasty runtime booger.
Show stopper.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants