Skip to content

Conversation

@pieh
Copy link
Contributor

@pieh pieh commented Feb 7, 2019

We currently swallow errors and display Cannot read property 'path' of undefined if error wasn't decorating with context[.path]. This can happen if error is thrown just when requiring render-page module (in

const htmlComponentRenderer = require(htmlComponentRendererPath)
)

It doesn't make sense to add path for page for those errors because it's not page specific and would throw for all pages, so instead let's add sanity check before trying to output path for page.

The bug can be reproduced by cloning https://github.com/dfds-frontend/gatsby-dfds-starter/tree/5f2568ebe3c79bfbc093a3d1fd7d78ae6da8f93e and commenting out en var sanity check in gatsby-config.js

@pieh pieh requested a review from a team February 7, 2019 12:31
Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pieh pieh merged commit 3ee60d5 into gatsbyjs:master Feb 7, 2019
@pieh pieh deleted the static-html-error-sanity-check branch February 7, 2019 12:41
@KyleAMathews
Copy link
Contributor

Nice!

@pieh pieh restored the static-html-error-sanity-check branch May 17, 2020 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants