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)'
Minimal reproduction: https://github.com/SimonSiefke/gatsby-bug
gatsby developNo Error
Error
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
I just reproduced this and I think there are 2 separate problems here:
rebuildSchemaWithSitePage (that's why I tagged with GraphQL label)onError handler to handle it - and handling it might just mean calling reporter.panic (that's why I tagged with State Machine label)
We just published [email protected] which fixes the root problem. I locally checked the provided reproduction and it no longer result in this error after upgrading gatsby.
Just encountered the same issue on [email protected] but upgrading to [email protected] fixed it. Just in case someone else comes across this again.
Its happening again on [email protected]
Also happening on @gatsby@^2.24.91
Also happening on [email protected]
Does gatsby clean work for you? I think it is working for me.
Does
gatsby cleanwork for you? I think it is working for me.
Yes, that seems to have worked for me too. I also noticed that if I use npm to update modules I get the issue but not if I use yarn.
Most helpful comment
Does
gatsby cleanwork for you? I think it is working for me.