From 7e7c0045155039a351dec742b2f564c09baa02d8 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Sat, 23 Nov 2024 05:39:08 +0100 Subject: [PATCH] remove unrelated --- packages/next/src/client/index.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/next/src/client/index.tsx b/packages/next/src/client/index.tsx index 5433c5bf6c1a6..42ebd0da9bb09 100644 --- a/packages/next/src/client/index.tsx +++ b/packages/next/src/client/index.tsx @@ -928,10 +928,7 @@ export async function hydrate(opts?: { beforeRender?: () => Promise }) { error.name = initialErr!.name error.stack = initialErr!.stack - - if ('digest' in initialErr) { - ;(error as any).digest = initialErr!.digest - } + const errSource = initialErr.source! // In development, error the navigation API usage in runtime, // since it's not allowed to be used in pages router as it doesn't contain error boundary like app router. @@ -940,8 +937,7 @@ export async function hydrate(opts?: { beforeRender?: () => Promise }) { 'Next.js navigation API is not allowed to be used in Pages Router.' } - const errSource = 'source' in initialErr ? initialErr.source : null - throw getServerError(error, errSource || 'server') + throw getServerError(error, errSource) }) } // We replaced the server-side error with a client-side error, and should