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, }