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.

Adding lowercase "graphql" to deck breaks parsing

See original GitHub issue

To reproduce just add the lowercased word “graphql” anywhere to your deck and start with mdx-deck deck.mdx

This is the error message printed

 ERROR #85911  GRAPHQL

There was a problem parsing "/home/alfiehub/decks/deck.mdx"; any GraphQL
fragments or queries in this file were not processed.

This may indicate a syntax error in the code, or it may be a file type
that Gatsby does not know how to parse.

File: ../../deck.mdx

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:13
  • Comments:7

github_iconTop GitHub Comments

6reactions
dylanirlbeckcommented, Apr 8, 2020

Can confirm this is still an issue. Dang this was annoying.

1reaction
ProchaLucommented, Oct 11, 2022

I got the same error when creating a slide deck. After some digging, I found that the problem was in the file node-mdules/gatsby/dist/query/file-parser.js

https://github.com/gatsbyjs/gatsby/blob/61f197d2c6deda2d45ba185df190301bb8219676/packages/gatsby/src/query/file-parser.js#L509-L517

After changing the if block the error went away and the slides were created.

  if (
-      !text.includes(`graphql`) &&
-      !text.includes(`gatsby-plugin-image`) &&
-      !text.includes(`getServerData`) &&
-      !text.includes(`config`) &&
-      !text.includes(`Slice`)
+      file.endsWith('.mdx') ||
+      (!text.includes(`graphql`) &&
+        !text.includes(`gatsby-plugin-image`) &&
+        !text.includes(`getServerData`) &&
+        !text.includes(`config`) &&
+.       !text.includes(`Slice`))
    ) {
      return null;
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

@upperCase, @lowerCase and @titleCase - GraphQL API for ...
The @upperCase , @lowerCase and @titleCase directives manipulate strings, changing them to upper, lower and title case respectively: History.
Read more >
GraphQL specification
These key words may appear in lowercase and still retain their meaning unless ... All fields selected by the fragment will be added...
Read more >
mdx-deck - Bountysource
Hello. In the sample I see how to use the Image component but how about images I have in my local repository? deck.mdx;...
Read more >
GraphQL query best practices
Operation naming, GraphQL variables, and more. ... The cache enables your server to skip parsing and validating operations that it's encountered before, ...
Read more >
What you need to know about GraphQL enums
Strings are case-sensitive and break GraphQL validations. Below is an example of how you might use the users query.
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