From 66c164918b356cd8e28999a5b986c2fd41e77155 Mon Sep 17 00:00:00 2001 From: hrmny Date: Mon, 16 Oct 2023 17:11:23 +0200 Subject: [PATCH] use json for loader options --- packages/next/src/build/entries.ts | 2 +- .../src/build/webpack/loaders/next-edge-ssr-loader/index.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/next/src/build/entries.ts b/packages/next/src/build/entries.ts index 828eb49bda84ef..07b0c6b46c2344 100644 --- a/packages/next/src/build/entries.ts +++ b/packages/next/src/build/entries.ts @@ -422,7 +422,7 @@ export function getEdgeServerEntry(opts: { } return { - import: `next-edge-ssr-loader?${stringify(loaderParams)}!`, + import: `next-edge-ssr-loader?${JSON.stringify(loaderParams)}!`, // The Edge bundle includes the server in its entrypoint, so it has to // be in the SSR layer — we later convert the page request to the RSC layer // via a webpack rule. diff --git a/packages/next/src/build/webpack/loaders/next-edge-ssr-loader/index.ts b/packages/next/src/build/webpack/loaders/next-edge-ssr-loader/index.ts index 1129b16052e8a6..6444a4f8922319 100644 --- a/packages/next/src/build/webpack/loaders/next-edge-ssr-loader/index.ts +++ b/packages/next/src/build/webpack/loaders/next-edge-ssr-loader/index.ts @@ -94,8 +94,7 @@ const edgeSSRLoader: webpack.LoaderDefinitionFunction = const buildInfo = getModuleBuildInfo(this._module as any) buildInfo.nextEdgeSSR = { - // @ts-expect-error === 'true' is correct because loader options are serialized as searchParams. Type needs to be fixed somehow. - isServerComponent: isServerComponent === 'true', + isServerComponent, page: page, isAppDir, }