Skip to content

Commit

Permalink
Ensure client reference manifest is traced for global not found page (#…
Browse files Browse the repository at this point in the history
…74919)

Follow-up fix for #74876. Not all app dir entries have an
`absolutePagePath` in their module build info, e.g. the global not found
page does not have one. But we still need to include the client
reference manifest in the trace for those entries.


[x-ref](https://vercel.com/vtest314-next-e2e-tests/vtest314-e2e-tests/EngjzrvvzQ4GQra6tnGCy98PR6yd/logs?startDate=1736936280&endDate=1736938140&selectedLogId=fl27k-1736937944551-421fa6816369)
  • Loading branch information
unstubbable authored Jan 15, 2025
1 parent cda3dbf commit 7999f96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,13 @@ export class TraceEntryPointsPlugin implements webpack.WebpackPluginInstance {
entrypoint.name
]?.replace(this.appDir, '')

const entryIsStaticMetadataRoute =
appDirRelativeEntryPath &&
isStaticMetadataRoute(appDirRelativeEntryPath)

// Include the client reference manifest in the trace, but not for
// static metadata routes, for which we don't generate those.
if (
appDirRelativeEntryPath &&
!isStaticMetadataRoute(appDirRelativeEntryPath)
) {
if (!entryIsStaticMetadataRoute) {
entryFiles.add(
nodePath.join(
outputPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ describe('prefetching-not-found', () => {
expect(await browser.elementByCss('h1').text()).toBe('Home Page')
})

// assert the same behavior, but starting at the not found page. This is to ensure that when we seed the prefetch cache,
// we don't have any cache collisions that would cause the not-found page to remain rendered when following a link to the home page
// Assert the same behavior, but starting at the not found page. This is to
// ensure that when we seed the prefetch cache, we don't have any cache
// collisions that would cause the not-found page to remain rendered when
// following a link to the home page.
browser = await next.browser('/fake-link')
expect(await browser.elementByCss('body').text()).toContain(
'This page could not be found.'
Expand Down

0 comments on commit 7999f96

Please sign in to comment.