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

Error: The result of this StaticQuery could not be fetched. (Just after installation of the plugin) #131

Closed
Antoine-lb opened this issue Jun 11, 2020 · 1 comment

Comments

@Antoine-lb
Copy link

Antoine-lb commented Jun 11, 2020

Hello,

I get the not very helpfull error from Gatsby as soon as I install gatsby-source-strapi and configure it:

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

My config:

  plugins: [
    {
      resolve: `gatsby-source-strapi`,
      options: {
        apiURL: `http://localhost:1337`,
        queryLimit: 1000,
        contentTypes: [`product`],
      },
    },
   ...

http://localhost:1337/products returns the products properly.

Is a very fresh install, with the latest versions of everything, try two times and I got the same issue just after installing.

How I installed

  1. npx create-strapi-app ecommerce-backend with QuickStart
  2. gatsby new ecommerce-frontend (in another folder)
  3. Create admin user and create some products
  4. Checked that http://localhost:1337/products works
  5. npm install --save gatsby-source-strapi
  6. Add minimal config
  7. npm i in the gatsby folder
  8. Re-run Gatsby server multiple times but the error does not leave

But I can fetch the products on localhost:8000/___graphql (lunched by Gatsby), so I can guess that Gatsby is able to get the data properly

Versions

Package.json

  "dependencies": {
    "gatsby": "^2.22.15",
    "gatsby-image": "^2.4.5",
    "gatsby-plugin-manifest": "^2.4.9",
    "gatsby-plugin-offline": "^3.2.7",
    "gatsby-plugin-react-helmet": "^3.3.2",
    "gatsby-plugin-sharp": "^2.6.9",
    "gatsby-source-filesystem": "^2.3.8",
    "gatsby-source-strapi": "0.0.12",
    "gatsby-transformer-sharp": "^2.5.3",
    "prop-types": "^15.7.2",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-helmet": "^6.0.0"
  },

NodeJS

v14.0.0

OS

MacOS Catalina 10.15.5

Edit

Tried again but this time with Node 12.18.0 and without creating any product (just creating the admin user and that's it), but I get the exact same result, as soon as the plugin is installed (even before starting to configure) the error appears and does not go away.

Thanks for the help!

@Antoine-lb
Copy link
Author

Never mind, seems to be a GastbyJS problem (gatsbyjs/gatsby#24902)

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

1 participant