Skip to content

Commit 3ee60d5

Browse files
authored
fix(gatsby): add sanity check before displaying path for static html build error (#11620)
1 parent 2032147 commit 3ee60d5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/gatsby/src/commands/build.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ module.exports = async function build(program: BuildArgs) {
6161
await buildHTML(program, activity).catch(err => {
6262
reportFailure(
6363
report.stripIndent`
64-
Building static HTML failed for path "${chalk.bold(err.context.path)}"
64+
Building static HTML failed${
65+
err.context && err.context.path
66+
? ` for path "${chalk.bold(err.context.path)}"`
67+
: ``
68+
}
6569
6670
See our docs page on debugging HTML builds for help https://gatsby.app/debug-html
6771
`,

0 commit comments

Comments
 (0)