Skip to content

Commit

Permalink
Ensure custom cache handlers are traced (#71521)
Browse files Browse the repository at this point in the history
This ensures we properly include this in our traces for output
standalone.

x-ref:
https://github.com/vercel/next.js/actions/runs/11418733317/attempts/2
  • Loading branch information
ijjk authored Oct 20, 2024
1 parent d4e390d commit 3cd1a74
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/next/src/build/collect-build-traces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ export async function collectBuildTraces({
]

const { cacheHandler } = config
const { cacheHandlers } = config.experimental

// ensure we trace any dependencies needed for custom
// incremental cache handler
Expand All @@ -257,6 +258,20 @@ export async function collectBuildTraces({
)
}

if (cacheHandlers) {
for (const handlerPath of Object.values(cacheHandlers)) {
if (handlerPath) {
sharedEntriesSet.push(
require.resolve(
path.isAbsolute(handlerPath)
? handlerPath
: path.join(dir, handlerPath)
)
)
}
}
}

const serverEntries = [
...sharedEntriesSet,
...(isStandalone
Expand Down

0 comments on commit 3cd1a74

Please sign in to comment.