question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GraphQL problem parsing query in gatsby@2.18.20 and later

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
city41commented, Jul 29, 2020

I just upgraded one of my apps to gatsby@2.24.14 and have hit this issue. I appear to have the same problem that @kije hit.

I get this error

 ERROR #85915  GRAPHQL
[1] 
[1] There was a problem parsing the GraphQL query in file: /home/matt/dev/jumpclub/packages/web-client/src/play/playSlice.ts

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

type Foo = ...

export { stuff, Foo, otherStuff }

If I change it to

export type Foo = ...

export { stuff, otherStuff }

the issue goes away.

2reactions
willpaigecommented, Feb 8, 2020

Yup, I’m getting what I expect as being a related issue. I’m unable to build with gatsby 2.19.7 as gatsby-source-contentful/src/fragments.js isn’t compatible.

Screenshot 2020-02-08 at 10 39 29 am
Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby fails to parse GraphQL in template - Stack Overflow
See the gist for all the templates. Gatsby fails with an error stating. There was a problem parsing "/Users/computa/Documents/prosjekter/funka/ ...
Read more >
There was an error while compiling your site's GraphQL queries.
Error: RelayParser: Encountered duplicate definitions for one or more documents: each document must have a unique name. Duplicated documents.
Read more >
gatsby/CHANGELOG.md - UNPKG
1800, - **gatsby:** Fix static query parsing for a special case ([#21551](https://github.com/gatsbyjs/gatsby/issues/21551)) ...
Read more >
Parsing problem netlify - Developing with Prismic
11:56:34 PM: error There was a problem parsing ... any GraphQL 11:56:34 PM: fragments or queries in this file were not processed.
Read more >
Problem parsing with the new gatsby-plugin-image - Support
I have a parsing problem in gatsy using the new ... any GraphQL 11:16:50 PM: fragments or queries in this file were not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found