Gatsby: WebpackError: The result of this StaticQuery could not be fetched.

Created on 21 Jul 2020  路  2Comments  路  Source: gatsbyjs/gatsby

Description

Build fails with:

WebpackError: The result of this StaticQuery could not be fetched.

pointing to this query:

const data = useStaticQuery(graphql`
  query ComponentsQuery {
    allFile(
      filter: { relativePath: { regex: "/^components/.*/index.js/" } }
      sort: { order: ASC, fields: relativePath }
    ) {
      edges {
        node {
          relativeDirectory
        }
      }
    }
  }
`);

Steps to reproduce

1. git clone https://github.com/moroshko/basis.git
2. cd basis
3. git checkout themes-refactor
4. npm install
5. npm run build

Expected result

Build should succeed.

Actual result

Build fails.

Environment

  System:
    OS: macOS 10.15.4
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.6.0 - ~/.nvm/versions/node/v12.6.0/bin/node
    Yarn: 1.22.4 - ~/.yarn/bin/yarn
    npm: 6.14.6 - ~/.nvm/versions/node/v12.6.0/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 84.0.4147.89
    Firefox: 78.0.2
    Safari: 13.1
bug

Most helpful comment

I upgraded gatsby from 2.24.1 to 2.24.7 and it fixed the issue.

All 2 comments

I upgraded gatsby from 2.24.1 to 2.24.7 and it fixed the issue.

I have a gatsby 2.24.7 and he still the same result.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimfilippou picture jimfilippou  路  3Comments

magicly picture magicly  路  3Comments

ghost picture ghost  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

Oppenheimer1 picture Oppenheimer1  路  3Comments