gatsby: Parsing Markdown files seems to randomly cause compilation error

Hello,

I am using this boilerplate which is linked to from the Gatsby site; https://github.com/Vagr9K/gatsby-material-starter and when it compiles, sometimes I get this error, and then it wont seem to clear;

GraphQL Error There was an error while compiling your site's GraphQL queries.
  Invariant Violation: GraphQLParser: Unknown field `nextTitle` on type `fields_2`. Source: document `BlogPostBySlug` file: `GraphQL request`.

I have tried using no markdown files, to see if it just loads the templates (it wont), putting the sample pages bundled with it back and also making new markdown files; it just seems to be a compiliation error or someone with the npm packages?

Can anyone offer any pointers? Is this a known issue - I want to use gatsby to replace a jeyll site is all.

I also raised an issue on the boilerplate; and it can be found here; https://github.com/Vagr9K/gatsby-material-starter/issues/26

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (4 by maintainers)

Most upvoted comments

@MaralS try to delete the ./cache folder after fixing the markdown on the files - that worked for me.

It looks like some sort of terminal errors get cached and the cache is not cleared when npm run develop is re-run.

The cache should be cleared on everyone run of develop, or else it defeats the purpose of the mode.

I always clean on build / develop. 😃

I found the issue for me. I had a noop.md file so that build wouldn’t break when the /blog was empty and than filtered them out in gatsby-node.js so they wouldn’t be included when building the site.

The problem was that noop.md didn’t include a proper date attribute, so when it parsed all of the blog posts and noop.md was parsed first, the build seemed to fail.

Yes, I have pinned it down to the markdown compilation, it seems to randomly break during a compilation and then cannot proceed when the process restarts.

I think clearer documentation for the markdown structure needed would help too.