gatsby: Missing onError handler for invocation 'rebuildSchemaWithSitePage'
Description
Missing onError handler for invocation 'rebuildSchemaWithSitePage', error was 'TypeError: Cannot read property 'contents' of null'. Stacktrace was 'TypeError: Cannot read property 'contents' of null
at get (/home/simon/tmp/bug-repro/node_modules/gatsby/src/utils/get-value-at.ts:10:20)
at map (/home/simon/tmp/bug-repro/node_modules/gatsby/src/utils/get-value-at.ts:20:59)
at Array.map (<anonymous>)
at getArray (/home/simon/tmp/bug-repro/node_modules/gatsby/src/utils/get-value-at.ts:19:6)
at get (/home/simon/tmp/bug-repro/node_modules/gatsby/src/utils/get-value-at.ts:12:36)
at get (/home/simon/tmp/bug-repro/node_modules/gatsby/src/utils/get-value-at.ts:13:50)
at get (/home/simon/tmp/bug-repro/node_modules/gatsby/src/utils/get-value-at.ts:13:50)
at get (/home/simon/tmp/bug-repro/node_modules/gatsby/src/utils/get-value-at.ts:13:50)
at getValueAt (/home/simon/tmp/bug-repro/node_modules/gatsby/src/utils/get-value-at.ts:4:10)
at getFirstValueAt (/home/simon/tmp/bug-repro/node_modules/gatsby/src/schema/infer/is-file.ts:14:15)
at find (/home/simon/tmp/bug-repro/node_modules/gatsby/src/schema/infer/is-file.ts:84:13)
at Array.find (<anonymous>)
at getFilePath (/home/simon/tmp/bug-repro/node_modules/gatsby/src/schema/infer/is-file.ts:83:41)
at isFile (/home/simon/tmp/bug-repro/node_modules/gatsby/src/schema/infer/is-file.ts:91:20)
at getSimpleFieldConfig (/home/simon/tmp/bug-repro/node_modules/gatsby/src/schema/infer/add-inferred-fields.js:315:11)
at getFieldConfig (/home/simon/tmp/bug-repro/node_modules/gatsby/src/schema/infer/add-inferred-fields.js:174:19)'
Steps to reproduce
Minimal reproduction: https://github.com/SimonSiefke/gatsby-bug
- Run
gatsby develop - Error occurs
Expected result
No Error
Actual result
Error
Environment
System:
OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 14.3.0 - ~/.nvm/versions/node/v14.3.0/bin/node
Yarn: 1.22.4 - ~/.nvm/versions/node/v14.3.0/bin/yarn
npm: 6.14.5 - ~/.nvm/versions/node/v14.3.0/bin/npm
Browsers:
Chrome: 84.0.4147.125
Firefox: 79.0
npmPackages:
gatsby: ^2.24.47 => 2.24.47
npmGlobalPackages:
gatsby-cli: 2.12.87
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 17
- Comments: 55 (5 by maintainers)
This is also happening in Gatsby V3
Im also having this error in Gatsby V3 , tried
gatsby cleanand deleting node_modules an reinstalling but the error persistThis is still impacting me too, but not sure how to catch this to get more verbosity:
https://github.com/gatsbyjs/gatsby-starter-landing-page
Getting stuck here, both on my bare metal and Gatsby coud build. Already tried all the suggestions from the above. Any ideas for debugging this?
Got the same problem on
gatsby@5.4.0while just simply starting a starter project. Tried all suggestions above all and nothing seems to workDoes
gatsby cleanwork for you? I think it is working for me.managed to get unstuck by moving from npm to yarn after running “rm -rf node_modules && rm -rf package-lock.json”
I ran into this very similar error again, updating a different project from 4 to 5:
There seems to be a possible problem with gatsby-plugin-react-leaflet (https://github.com/dweirich/gatsby-plugin-react-leaflet/issues/31) but the error message does not seem to relate to that.
Edit: Above error was due to multiple competing versions of graphql used by dependencies. See https://www.gatsbyjs.com/docs/reference/release-notes/migrating-from-v4-to-v5/#multiple-versions-of-graphql, also for solutions.
It happens again on Gatsby version 4.10.0
I’m experiencing the same issue on Gatsby Version 3.10.0
Also happening on “gatsby”: “^4.14.0”, This problem has been around for so long, is there a good solution ?
Missing onError handler for invocation 'building-schema', error was 'Error: Cannot create as TypeComposer the following value:Still happening on:
Gatsby CLI version: 3.10.0 Gatsby version: 3.9.1
after adding the gatsby-source-rest-api plugin.
Should this not be re-opened?
I was able to solve this in V3 but updating graphql to version “^15.4.0”
Facing the same issue on
gatsby@^4.9.3andgatsby-cli@3.11.0I am facing a similar issue:
but
rm -rf node_modules && rm -rf package-lock.jsondoesn’t really seems to work.We just published
gatsby@2.24.49which fixes the root problem. I locally checked the provided reproduction and it no longer result in this error after upgradinggatsby.I could solve this issue by removing graphql from my project.
It’s not needed, gatsby has its own via
import { graphql } from 'gatsby';Thank you @barbalex for your comments - that was a lifesaver when upgrading 4->5.
I’m leaving my notes in case someone else like me finds this.
In my case, it was also competing graphql, but it was the gatsby images/sharp/transfomer plugins asking for 16 and gatsby 5 asking for 15. Running
npm ls graphqlgave me this (truncated):I fixed this by deleting
node_modulesandpackage-lock.json, and then running:It all seems to be at
graphql@16.6.0now.Original error was:
Running
gatsby cleansolved it for meits happening to me too, when i edit the markdown content, its error always showing and server stuck. after restart the server then no error, and i edit the markdown content again, error showing again 😐
Also happening on
gatsby@2.30.1,gatsby-cli@2.15.0and i solved this issue by delete thesanitypluginIts happening again on
gatsby@2.24.86Gatsby has been clearly completely killed by Netlify. It’s time for everyone to migrate to Astro, if anyone is still here… I’ve migrated a huge project to Astro, it’s missing some of the nice features Gatsby had (components shadowing mostly) but it’s doable and the end result is so much more performant…
Missing onError handler for invocation ‘building-schema’, error was ‘Error: Cannot create as TypeComposer the following value: GraphQLScalarType({ name: “Date”, description: “A date string, such as 2007-12-03, compliant with the ISO 8601 standard for representation of dates and times using the Gregorian calendar.”, specifiedByURL: undefined, serialize: [function String], parseValue: [function String], parseLiteral: [function parseLiteral], extensions: { }, astNode: undefined, extensionASTNodes: [] }).’. Stacktrace was 'Error: Cannot create as TypeComposer the following value: GraphQLScalarType({ name: “Date”, description: “A date string, such as 2007-12-03, compliant with the ISO 8601 standard for representation of dates and times using the Gregorian calendar.”, specifiedByURL: undefined, serialize: [function String], parseValue: [function String], parseLiteral: [function parseLiteral], extensions: { }, astNode: undefined, extensionASTNodes: [] }).
Experiencing the same error in gatsby while updating from version 3 to version 5.
moving from npm to yarn worked out for me too
Also happening on
@gatsby@^2.24.91