gatsby: GraphQL problem parsing query in gatsby@2.18.20 and later
After upgrading from gatsby@2.18.19-jobs-api-v2.39 to gatsby@2.18.20 (and all later versions) I get this error
ERROR #85915 GRAPHQL There was a problem parsing the GraphQL query in file:
src/components/Nav/index.js
The file in question looks pretty harmless. So maybe the changes introduced a bug? The log states:
Bug Fixes gatsby: Webpack /_ webpackPrefetch/webpackPreload _/ comments causing a bug (#20403) (1b89b10) Features gatsby: Allow alternative import syntax for useStaticQuery (#20330) (17eaa72)
#20330 sounds like it might be related.
Environment
`gatsby info --clipboard`
System: OS: macOS 10.15.3 CPU: (16) x64 Intel® Core™ i9-9880H CPU @ 2.30GHz Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.13.1 - /usr/local/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.13.6 - /usr/local/bin/npm Languages: Python: 2.7.16 - /usr/bin/python Browsers: Chrome: 79.0.3945.130 Safari: 13.0.5 npmPackages: gatsby: 2.18.20 => 2.18.20 gatsby-image: 2.2.40 => 2.2.40 gatsby-plugin-algolia: ^0.5.0 => 0.5.0 gatsby-plugin-catch-links: 2.1.25 => 2.1.25 gatsby-plugin-favicon: ^3.1.6 => 3.1.6 gatsby-plugin-feed-mdx: ^1.0.1 => 1.0.1 gatsby-plugin-google-analytics: 2.1.35 => 2.1.35 gatsby-plugin-lodash: ^3.1.16 => 3.1.20 gatsby-plugin-manifest: 2.2.41 => 2.2.41 gatsby-plugin-mdx: ^1.0.59 => 1.0.70 gatsby-plugin-netlify-cache: ^1.2.0 => 1.2.0 gatsby-plugin-offline: 3.0.34 => 3.0.34 gatsby-plugin-react-helmet: 3.1.22 => 3.1.22 gatsby-plugin-sharp: 2.4.5 => 2.4.5 gatsby-plugin-styled-components: ^3.1.19 => 3.1.19 gatsby-remark-autolink-headers: ^2.1.19 => 2.1.24 gatsby-remark-code-titles: ^1.1.0 => 1.1.0 gatsby-remark-copy-linked-files: ^2.1.31 => 2.1.37 gatsby-remark-embed-video: 2.0.1 => 2.0.1 gatsby-remark-emojis: ^0.4.2 => 0.4.2 gatsby-remark-images: 3.1.44 => 3.1.44 gatsby-remark-katex: ^3.1.18 => 3.1.24 gatsby-remark-responsive-iframe: 2.2.32 => 2.2.32 gatsby-remark-smartypants: 2.1.21 => 2.1.21 gatsby-remark-sub-sup: ^1.0.0 => 1.0.0 gatsby-remark-vscode: ^2.0.1 => 2.0.1 gatsby-source-filesystem: 2.1.48 => 2.1.48 gatsby-transformer-sharp: 2.3.14 => 2.3.14 gatsby-transformer-yaml: 2.2.24 => 2.2.24
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 16 (10 by maintainers)
I just upgraded one of my apps to
gatsby@2.24.14and have hit this issue. I appear to have the same problem that @kije hit.I get this error
But the file in question has no graphql in it at all. It does export a type along other things at the bottom of the file
If I change it to
the issue goes away.
Yup, I’m getting what I expect as being a related issue. I’m unable to build with
gatsby 2.19.7asgatsby-source-contentful/src/fragments.jsisn’t compatible.So this was happening because of this line:
The new algorithm didn’t account for this case.
Here is an actual error (swallowed by gatsby catch block here):
So it is definitely #20330 causing this.
CC @jfrolich