QardsJs / qards

Qards is a blogging platform focused on performance and on closing the gap between content publishers and developers: https://qards.io
MIT License
239 stars 16 forks source link

build failed: TypeError: Cannot read property 'image' of null #75

Closed fr0der1c closed 5 years ago

fr0der1c commented 5 years ago

I've encountered into a list of failed deploys. The log is like this:

10:58:11 PM:   43 |             <Wrapper to={tokenizedPost.fields.slug}>
10:58:11 PM:   44 |                 <Flex flexWrap="wrap">
10:58:11 PM: > 45 |                     {tokenizedPost.frontmatter.hero.image && <Box pr={30} width={this.heroImgBoxWidth}>
10:58:11 PM:      |                                                     ^
10:58:11 PM:   46 |                         <Image>
10:58:11 PM:   47 |                             <Img fluid={tokenizedPost.frontmatter.hero.image.sharp.fluid}/>
10:58:11 PM:   48 |                         </Image>
10:58:11 PM: 
10:58:11 PM:   WebpackError: TypeError: Cannot read property 'image' of null
10:58:11 PM:   
10:58:11 PM:   - index.tsx:45 FeaturedPost.render
10:58:11 PM:     lib/src/components/featured-post/index.tsx:45:38

Does a image is required for every post?

ciokan commented 5 years ago

As it is right now...yes but it shouldn't be. I hope to get the time next week and look into your issues so far.

ciokan commented 5 years ago

Closed in: https://github.com/QardsJs/qards/commit/0c78b60c71cf34f8c76d000f55f9f20f9b66cfc0#diff-3ca99c4ed549230d872bfafa299358a2