Skip to content

Commit 166487c

Browse files
committed
fix: switch to definition as cache-key
1 parent ae09439 commit 166487c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/next/src/server/dev/on-demand-entry-handler.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,13 @@ export function onDemandEntryHandler({
888888
}
889889

890890
// Make sure that we won't have multiple invalidations ongoing concurrently.
891-
const batcher = Batcher.create<EnsurePageOptions, void, string>({
891+
const batcher = Batcher.create<
892+
Omit<EnsurePageOptions, 'match'> & {
893+
definition?: RouteDefinition
894+
},
895+
void,
896+
string
897+
>({
892898
// The cache key here is composed of the elements that affect the
893899
// compilation, namely, the page, whether it's client only, and whether
894900
// it's an app page. This ensures that we don't have multiple compilations
@@ -924,7 +930,7 @@ export function onDemandEntryHandler({
924930
// wrapper, which will ensure that we don't have multiple compilations
925931
// for the same page happening concurrently.
926932
return batcher.batch(
927-
{ page, clientOnly, appPaths, match, isApp },
933+
{ page, clientOnly, appPaths, definition: match?.definition, isApp },
928934
async () => {
929935
await ensurePageImpl({ page, clientOnly, appPaths, match, isApp })
930936
}

0 commit comments

Comments
 (0)