Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
)
}
}
await createIndexHtml(indexHTMLActivity)
indexHTMLActivity.end()
// report.stateUpdate(`webpack`, `IN_PROGRESS`)
const webpackActivity = report.activityTimer(`Building development bundle`, {
id: `webpack-develop`,
})
webpackActivity.start()
const devConfig = await webpackConfig(
program,
directory,
`develop`,
program.port,
{ parentSpan: webpackActivity.span }
)
const compiler = webpack(devConfig)
/**
* Set up the express app.
const refresh = async (req: express.Request) => {
let activity = report.activityTimer(`createSchemaCustomization`, {})
activity.start()
await createSchemaCustomization({
refresh: true,
})
activity.end()
activity = report.activityTimer(`Refreshing source data`, {})
activity.start()
await sourceNodes({
webhookBody: req.body,
})
activity.end()
}
app.use(REFRESH_ENDPOINT, express.json())
const refresh = async (req: express.Request) => {
let activity = report.activityTimer(`createSchemaCustomization`, {})
activity.start()
await createSchemaCustomization({
refresh: true,
})
activity.end()
activity = report.activityTimer(`Refreshing source data`, {})
activity.start()
await sourceNodes({
webhookBody: req.body,
})
activity.end()
}
app.use(REFRESH_ENDPOINT, express.json())
exports.onPostBuild = async function(
{ graphql },
{ appId, apiKey, queries, indexName: mainIndexName, chunkSize = 1000 }
) {
const activity = report.activityTimer(`index to Algolia`);
activity.start();
const client = algoliasearch(appId, apiKey);
setStatus(activity, `${queries.length} queries to index`);
const jobs = queries.map(async function doQuery(
{ indexName = mainIndexName, query, transformer = identity, settings },
i
) {
if (!query) {
report.panic(
`failed to index to Algolia. You did not give "query" to this query`
);
}
const index = client.initIndex(indexName);
const mainIndexExists = await indexExists(index);
compiler.hooks.watchRun.tapAsync(`log compiling`, function(_, done) {
if (webpackActivity) {
webpackActivity.end()
}
webpackActivity = report.activityTimer(`Re-building development bundle`, {
id: `webpack-develop`,
})
webpackActivity.start()
done()
})