diff --git a/packages/next/src/build/webpack/loaders/next-flight-client-entry-loader.ts b/packages/next/src/build/webpack/loaders/next-flight-client-entry-loader.ts index 5fb5142d46fd8..819154545a01a 100644 --- a/packages/next/src/build/webpack/loaders/next-flight-client-entry-loader.ts +++ b/packages/next/src/build/webpack/loaders/next-flight-client-entry-loader.ts @@ -65,6 +65,5 @@ export default function transformSource( type: RSC_MODULE_TYPES.client, } - const suffix = isServer ? 'export const __esm = 1;' : '' - return code + '\n' + suffix + return code } diff --git a/packages/next/src/server/app-render/create-component-tree.tsx b/packages/next/src/server/app-render/create-component-tree.tsx index da2370b11316e..3e6f0b6a746a8 100644 --- a/packages/next/src/server/app-render/create-component-tree.tsx +++ b/packages/next/src/server/app-render/create-component-tree.tsx @@ -280,7 +280,7 @@ async function createComponentTreeInternal({ if (hasSlotKey && rootLayoutAtThisLevel && LayoutOrPage) { Component = (componentProps: { params: Params }) => { const NotFoundComponent = NotFound - const RootLayoutComponent = LayoutOrPage! + const RootLayoutComponent = LayoutOrPage return (