Skip to content

Commit

Permalink
fix(gatsby): add sanity check before displaying path for static html …
Browse files Browse the repository at this point in the history
…build error (#11620)
  • Loading branch information
pieh committed Feb 7, 2019
1 parent 2032147 commit 3ee60d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/gatsby/src/commands/build.js
Expand Up @@ -61,7 +61,11 @@ module.exports = async function build(program: BuildArgs) {
await buildHTML(program, activity).catch(err => {
reportFailure(
report.stripIndent`
Building static HTML failed for path "${chalk.bold(err.context.path)}"
Building static HTML failed${
err.context && err.context.path
? ` for path "${chalk.bold(err.context.path)}"`
: ``
}
See our docs page on debugging HTML builds for help https://gatsby.app/debug-html
`,
Expand Down

0 comments on commit 3ee60d5

Please sign in to comment.