Skip to content

Commit

Permalink
fix edge default not found
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jul 18, 2023
1 parent 19a7375 commit 4fb3055
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/next/src/server/app-render/app-render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,10 @@ export async function renderToHTMLOrFlight(
pathname
)

const useDefaultError = isMetadataNotFound || (is404 && !NotFound)
const useDefaultError =
isMetadataNotFound ||
(is404 && !NotFound) ||
pagePath === '/_not-found'

// Preserve the existing RSC inline chunks from the page rendering.
// For 404 errors: the metadata from layout can be skipped with the error page.
Expand All @@ -1659,7 +1662,7 @@ export async function renderToHTMLOrFlight(
{
...serverComponentsRenderOpts,
rscChunks: [],
transformStream: isMetadataNotFound
transformStream: useDefaultError
? new TransformStream()
: cloneTransformStream(
serverComponentsRenderOpts.transformStream
Expand Down

0 comments on commit 4fb3055

Please sign in to comment.