Skip to content

Commit 51e091d

Browse files
authored
Fix prerender tags when notFound is called (#74577)
This ensures we don't lose tags added to a page before `notFound()` is called as otherwise a fetch on the page that has been revalidated won't be able to be applied correctly if dropped from a `notFound()` call. This was broken recently in the refactors of handling rendering in app-render as it worked correctly in `v14`. x-ref: [slack thread](https://vercel.slack.com/archives/C04V3E1UYNQ/p1736200963684869) Closes https://linear.app/vercel/issue/ENET-1381 Closes https://linear.app/vercel/issue/NEXT-3946 Closes #73973 Closes #66540
1 parent 5a8d117 commit 51e091d

File tree

3 files changed

+1986
-1850
lines changed

3 files changed

+1986
-1850
lines changed

packages/next/src/server/app-render/app-render.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3833,7 +3833,7 @@ async function prerenderToStream(
38333833
revalidate: INFINITE_CACHE,
38343834
expire: INFINITE_CACHE,
38353835
stale: INFINITE_CACHE,
3836-
tags: [...implicitTags],
3836+
tags: [...(prerenderStore?.tags || implicitTags)],
38373837
})
38383838
const errorRSCPayload = await workUnitAsyncStorage.run(
38393839
prerenderLegacyStore,

0 commit comments

Comments
 (0)