Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function formatError(message: string, filePath: string, codeFrame: string) {
return (
report.stripIndent`
${message}
${formatFilePath(filePath)}
` + `\n\n${codeFrame}\n`
)
}
const createIndexHtml = async (activity: ActivityTracker) => {
try {
await buildHTML.buildPages({
program,
stage: `develop-html`,
pagePaths: [`/`],
workerPool,
activity,
})
} catch (err) {
if (err.name !== `WebpackError`) {
report.panic(err)
return
}
report.panic(
report.stripIndent`
There was an error compiling the html.js component for the development server.
See our docs page on debugging HTML builds for help https://gatsby.dev/debug-html
`,
err
)
}
}