Skip to content

Commit

Permalink
fix(gatsby): node manifests v2 inc builds (#34086)
Browse files Browse the repository at this point in the history
* only log error id array if there are errors

* fix createNodeManifest 2.0 for inc-builds
  • Loading branch information
TylerBarnes authored Nov 27, 2021
1 parent a7f3f85 commit 63183e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby/src/utils/node-manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ export async function processNodeManifests(): Promise<Map<
)

reporter.info(
(!verboseLogs
(!verboseLogs && listOfUniqueErrorIds.size > 0
? `unstable_createNodeManifest produced warnings [${[
...listOfUniqueErrorIds,
].join(`, `)}]. `
Expand Down
11 changes: 8 additions & 3 deletions packages/gatsby/src/utils/page-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,14 @@ export async function flush(parentSpan?: Span): Promise<void> {
)
writePageDataActivity.start()

// we process node manifests in this location because we need to add the manifestId to the page data.
// We use this manifestId to determine if the page data is up to date when routing. Here we create a map of "pagePath": "manifestId" while processing and writing node manifest files.
const nodeManifestPagePathMap = await processNodeManifests()
let nodeManifestPagePathMap

if (pagePaths.size > 0) {
// we process node manifests in this location because we need to add the manifestId to the page data.
// We use this manifestId to determine if the page data is up to date when routing. Here we create a map of "pagePath": "manifestId" while processing and writing node manifest files.
// We only do this when there are pending page-data writes because otherwise we could flush pending createNodeManifest calls before page-data.json files are written. Which means those page-data files wouldn't have the corresponding manifest id's written to them.
nodeManifestPagePathMap = await processNodeManifests()
}

const flushQueue = fastq(async (pagePath, cb) => {
const page = pages.get(pagePath)
Expand Down

0 comments on commit 63183e3

Please sign in to comment.