gatsby: GraphQL error after updating gatsby (from 1.9.42 to 1.9.43)
Bumped deps this morning to pull in the recent gatsby-plugin-sharp
fix (#2205) and in doing so I also updated the gatsby
package itself. After doing this the React Gatsby site shows the following error while building:
GraphQL Error There was an error while compiling your site’s GraphQL queries.
The particular query that starts failing seems to be in the Home template.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 32 (30 by maintainers)
However, I will post a link to your PR on the internal forum and mention this. 😄
I’m getting the same error. When I run
npm dedupe
, it responds withnpm ERR! Cannot read property 'length' of undefined
(the full log for the error is here). Adding theresolutions
entry above doesn’t fix the queries.poke em for me 😉
node_modules/relay-compiler/node_modules/graphql/package.json
~> 0.10.5node_modules/graphql
~> 0.10.3I believe I can work around this temporarily by adding the following to
package.json
:I was trying with npm and it deduped the
graphql
s for me, i just tried again yarn and am seeing it. I’m not sure sure yarn isn’t deduping it tho, the ranges should be compatible for both…This is an annoying issue that we aren’t really sure how to fix apart from making graphql not care about instanceof checks (FYI i have a PR out to fix this but no comments so far on it: https://github.com/graphql/graphql-js/pull/989 if you wanted to voice something 😉 )
You should yell over at your GraphQL collegues to fix this 😉
This is probably what’s causing the trouble. Either run
dedupe
as directed. If that doesn’t fix it, you can also runfind node_modules -name graphql
to find the duplicate versions of the package.It’s weird that multiple versions are being required though. If it’s Gatsby’s fault, we need to sync up the versions of GraphQL we’re requiring so only one package is brought in.
o joy I thought was squashed the last of these generic GQL errors. let me pull the branch and try and debug it. I have a sense of what it might be