Gatsby: [www] gatsby develop error

Created on 16 Feb 2018  路  8Comments  路  Source: gatsbyjs/gatsby

Description

Editing a markdown file can cause the site to error while gatsby develop is running.

Environment

Gatsby version: from master
Node.js version: 9.5.0
Operating System: macOS

File contents (if changed):

see https://github.com/gatsbyjs/gatsby/tree/c246262d10830eda09135ff5f8a3ee64883757ce/www

Actual result

Page displays an error:

screen shot 2018-02-16 at 21 58 05

Expected behavior

Page should not display an error 馃槃

Steps to reproduce

  • in this repo, cd www
  • rm -r .cache
  • yarn run develop
  • browse to http://localhost:8000/docs/graphql-reference/
  • edit and save docs/docs/graphql-reference.md
  • wait for auto-page reload (or refresh the browser)
  • There will be an error TypeError: Cannot read property 'markdownRemark' of undefined, which will remain until deleting the .cache directory

I've been able to recreate this with various docs pages and blog posts - all markdown files. Maybe the query data isn't being retrieved from the cache properly?

This query will still work in graphiql:

{    
  markdownRemark(fields: { slug: { eq: "/docs/querying-with-graphql/" } }) {
      html
      excerpt
      timeToRead
      fields {
        slug
        anchor
      }
      frontmatter {
        title
      }

    }
}

All 8 comments

Saw this too just now.

I wonder if this is similar to the issue that @peduarte was seeing earlier today?

Nope, actually my issue was me being stupid and using mutable array methods on props.data 馃槖馃敨

I got the same issue. If I had link in .md, browser throw me the exact same error.
[Edit] I don't know why but It seems a little bit random to me. I didn't change anything and it works now. \o/
[Edit 2] I add a new link and got the error again.

Same issue here, every time I edit a markdown file.

but yeah this issue happens to me, when I edit a markdown file. but not ALL the time.

I'm seeing this issue, too. Bare bones Gatsby install. Just added transformer remark. Most edits to my .md file break the develop build and I have to restart the server to get it working again.

This should have fixed the bug, thanks for your patience!

https://github.com/gatsbyjs/gatsby/pull/4213/files/cb52bc81b85f466e846da528bc0ec9b0eead9ec4#diff-a45448af33cc109010d5aab8911336dd

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andykais picture andykais  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

mikestopcontinues picture mikestopcontinues  路  3Comments

totsteps picture totsteps  路  3Comments

ferMartz picture ferMartz  路  3Comments