gatsby-starter-personal-blog icon indicating copy to clipboard operation
gatsby-starter-personal-blog copied to clipboard

TypeError: Cannot read property 'slug' of null

Open vadymus opened this issue 5 years ago • 1 comments

I started adding new posts to the blog following the format of markdown and after a few successful additions this error suddenly comes up:

TypeError: Cannot read property 'slug' of null

ListItem.render
src/components/Navigator/ListItem.js:144
  141 | <li
  142 |   className={`${classes.listItem} ${post.node.frontmatter.category}`}
  143 |   style={{ display: `${this.state.hidden ? "none" : "block"}` }}
> 144 |   key={post.node.fields.slug}
  145 | >
  146 |   <Link
  147 |     activeClassName="active"

When removing "problematic" posts, error persists. So it still persists with good posts and sometimes works with problematic posts. I am at a loss with a reason.

Are you able to point to what this means or how to address it?

vadymus avatar Nov 05 '19 17:11 vadymus

I don't know the exact reason, But delete .cache folder and run gatsby develop again. It will work well.

cron-tab avatar Jan 26 '20 12:01 cron-tab