diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index bd7180c2029f8..afcdd59e2ed59 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -1844,11 +1844,11 @@ async function renderToStream( throw err } - let errorType: 'not-found' | 'redirect' | undefined + let errorType: MetadataErrorType | 'redirect' | undefined if (isHTTPAccessFallbackError(err)) { res.statusCode = getAccessFallbackHTTPStatus(err) - errorType = 'not-found' + errorType = getAccessFallbackErrorTypeByStatus(res.statusCode) } else if (isRedirectError(err)) { errorType = 'redirect' res.statusCode = getRedirectStatusCodeFromError(err)