ehowey / gatsby-theme-catalyst

An opinionated set of integrated themes and starters as a boilerplate to accelerate development with GatsbyJS
MIT License
163 stars 15 forks source link

Site fails with Error in function useStaticQuery #1277

Closed thomasmost closed 3 years ago

thomasmost commented 3 years ago

Site doesn't load, instead an error is reported advising me to open a bug

Description

Multiple unhandled runtime errors found in your files. See the list below to fix them:

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

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

Error in function FeaturedLogos in ./node_modules/gatsby-theme-catalyst-hydrogen/src/components/home-page/home-logos.js:38

Error in function FeaturedWork in ./node_modules/gatsby-theme-catalyst-hydrogen/src/components/home-page/home-work.js:44

Error in function HomeContact in ./node_modules/gatsby-theme-catalyst-hydrogen/src/components/home-page/home-contact.js:21

Error in function SiteFooter in ./node_modules/gatsby-theme-catalyst-footer/src/components/footer.js:61

Steps to reproduce

Check out https://github.com/thomasmost/pscsite, run npm i --legacy-peer-deps and gatsby develop

Expected result

The page should load

Actual result

The Error message above

Environment

  System:
    OS: macOS 11.2.3
    CPU: (8) arm64 Apple M1
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.1.0 - /usr/local/bin/node
    npm: 7.17.0 - /usr/local/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Safari: 14.0.3
  npmPackages:
    gatsby: ^3.7.2 => 3.7.2
    gatsby-image: ^3.7.1 => 3.7.1
    gatsby-plugin-google-fonts: ^1.0.1 => 1.0.1
    gatsby-plugin-image: ^1.7.1 => 1.7.1
    gatsby-plugin-sharp: ^3.7.1 => 3.7.1
    gatsby-theme-catalyst-hydrogen: ^6.0.0 => 6.0.0
  npmGlobalPackages:
    gatsby-cli: 3.6.0
ehowey commented 3 years ago

Hey Thomas - looking at your repo it appears you are on an old version of the themes. If you are in the process of upgrading then you would want to follow the migration guide, from where you are to v6 was a fairly major update but there are step by step instructions here: https://www.gatsbycatalyst.com/docs/migrating/#v600

Let me know if you run into anything you need help with.

Also as an FYI - many packages went straight from v1 or v2 to v6 so that I could unify the versioning to make it easier to track and manage changes across the themes.

thomasmost commented 3 years ago

okay, thank you. How weird—I only set this up for the first time a few months ago!

thomasmost commented 3 years ago

Nvm, I seem to be okay now. It was an issue with my Sanity upgrade