smakosh / gatsby-portfolio-dev

A portfolio for developers

Home Page:https://portfolio.smakosh.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"gatsby-source-graphql" / ERROR #11321 PLUGIN

thomasfaller opened this issue · comments

Hey,

Right after a fresh install and typing gatsby develop I get an error apparently linked to the gatsby-source-graphql.

Here's the stack trace:

gatsby develop
success open and validate gatsby-configs - 0.072s
success load plugins - 1.403s
success onPreInit - 0.014s
success initialize cache - 0.017s
success copy gatsby files - 0.130s
success onPreBootstrap - 0.008s
success createSchemaCustomization - 0.006s

 ERROR #11321  PLUGIN

"gatsby-source-graphql" threw an error while running the sourceNodes lifecycle:

Response not successful: Received status code 401

warn The gatsby-source-graphql plugin has generated no Gatsby nodes. Do you need it?
success source and transform nodes - 0.411s
success building schema - 0.360s
success createPages - 0.004s
success createPagesStatefully - 0.206s
success onPreExtractQueries - 0.003s
success update schema - 0.069s

 ERROR #85923  GRAPHQL

There was an error in your GraphQL query:

Cannot query field "github" on type "Query".

If you don't expect "github" to exist on the type "Query" it is most likely a typo.
However, if you expect "github" to exist there are a couple of solutions to common problems:

- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
- You want to optionally use your field "github" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content")

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "Query":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

File: src/components/landing/Projects/index.jsx:18:9

failed extract queries from components - 0.452s
success write out requires - 0.072s
success write out redirect data - 0.006s
warn The icon(./static/favicon/favicon-512.png) you provided to 'gatsby-plugin-manifest' is not square.
The icons we generate will be square and for the best results we recommend you provide a square icon.

success Build manifest and related icons - 0.250s
success onPostBootstrap - 0.292s

info bootstrap finished - 9.413 s

success run queries - 0.054s - 4/4 73.67/s

I commented on the issue in the following thread first before opening a new issue -> gatsbyjs/gatsby#20015

Here's my dependencies if it helps:

"dotenv": "^6.2.0",
    "formik": "^1.4.1",
    "gatsby": "^2.17.7",
    "gatsby-image": "^2.2.30",
    "gatsby-plugin-canonical-urls": "^2.0.8",
    "gatsby-plugin-favicon": "^3.1.6",
    "gatsby-plugin-google-analytics": "^2.0.8",
    "gatsby-plugin-manifest": "^2.2.6",
    "gatsby-plugin-nprogress": "^2.0.7",
    "gatsby-plugin-offline": "^3.0.14",
    "gatsby-plugin-react-helmet": "^3.0.2",
    "gatsby-plugin-sharp": "^2.2.13",
    "gatsby-plugin-sitemap": "^2.0.3",
    "gatsby-plugin-styled-components": "^3.0.4",
    "gatsby-source-filesystem": "^2.1.35",
    "gatsby-source-graphql": "^2.1.21",
    "gatsby-transformer-sharp": "^2.2.7",
    "prop-types": "^15.6.2",
    "react": "^16.11.0",
    "react-anchor-link-smooth-scroll": "^1.0.12",
    "react-dom": "^16.11.0",
    "react-google-recaptcha": "^1.0.5",
    "react-helmet": "^5.2.0",
    "styled-components": "^4.1.3",
    "yup": "^0.26.6"

You most likely forgot to create the .env file with your github token

I'm having the same problem and I've created my github token - I believe error #85923 is from the github token, but error #11321 is only happening if I try to deploy to Zeit. Netlify says it successfully deploys but the site never goes up. When I run locally with gatsby develop it works completely.

For now adding a token in a .env file solves it as far as launching npm startis concerned. Haven't tried deploying yet.
When deploying on Netlify, you will have to set the private key as well so that might be the issue @darkintanner ?

SITE_RECAPTCHA_KEY=xxxxx
SITE_RECAPTCHA_SECRET=xxxxx

I'm having the same problem and I've created my github token - I believe error #85923 is from the github token, but error #11321 is only happening if I try to deploy to Zeit. Netlify says it successfully deploys but the site never goes up. When I run locally with gatsby develop it works completely.

It won't work on ZEIT Now as you will have to switch from Netlify forms to something like Formik.com and add Now secrets.

For now adding a token in a .env file solves it as far as launching npm startis concerned. Haven't tried deploying yet.
When deploying on Netlify, you will have to set the private key as well so that might be the issue @darkintanner ?

SITE_RECAPTCHA_KEY=xxxxx
SITE_RECAPTCHA_SECRET=xxxxx

Screen Shot 2020-03-13 at 19 28 32