From 7a6df73bcd89786cc01e7f1ccb5d31688d33254e Mon Sep 17 00:00:00 2001 From: bravepg Date: Tue, 3 Sep 2024 09:59:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20route=20=E5=8F=AF=E8=83=BD=E9=80=9A?= =?UTF-8?q?=E8=BF=87=20pacthRoutes=20=E6=8A=8A=20id=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/server/src/ssr.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/server/src/ssr.ts b/packages/server/src/ssr.ts index d428a8640f81..80178a6015d8 100644 --- a/packages/server/src/ssr.ts +++ b/packages/server/src/ssr.ts @@ -117,9 +117,15 @@ function createJSXGenerator(opts: CreateRequestHandlerOptions) { const loaderData: Record = {}; // let metadata: Record = {}; + await Promise.all( matches - .filter((id: string) => routes[id].hasServerLoader) + .filter( + (id: string) => + routes[ + Object.keys(routes).find((key) => routes[key].id == id) as string + ]?.hasServerLoader, + ) .map( (id: string) => new Promise(async (resolve) => { From 4e29ee2f55630d76a8b94771289eae6392df6962 Mon Sep 17 00:00:00 2001 From: bravepg Date: Tue, 3 Sep 2024 10:13:24 +0800 Subject: [PATCH 2/2] fix: remove unused change --- packages/server/src/ssr.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/server/src/ssr.ts b/packages/server/src/ssr.ts index 80178a6015d8..6d6e14f9dd7e 100644 --- a/packages/server/src/ssr.ts +++ b/packages/server/src/ssr.ts @@ -117,7 +117,6 @@ function createJSXGenerator(opts: CreateRequestHandlerOptions) { const loaderData: Record = {}; // let metadata: Record = {}; - await Promise.all( matches .filter(