From 3e27c1c52bba309e6b6fb2230823fec4572dfce0 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Tue, 9 Aug 2022 20:25:35 +0200 Subject: [PATCH] fix(nuxt): interopDefault for page component imports (#6468) --- packages/nuxt/src/pages/utils.ts | 2 +- packages/schema/src/config/experimental.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/nuxt/src/pages/utils.ts b/packages/nuxt/src/pages/utils.ts index c63d163427..29ae037322 100644 --- a/packages/nuxt/src/pages/utils.ts +++ b/packages/nuxt/src/pages/utils.ts @@ -237,7 +237,7 @@ export function normalizeRoutes (routes: NuxtPage[], metaImports: Set = children: route.children ? normalizeRoutes(route.children, metaImports).routes : [], meta: route.meta ? `{...(${metaImportName} || {}), ...${JSON.stringify(route.meta)}}` : metaImportName, alias: `${metaImportName}?.alias || []`, - component: genDynamicImport(file) + component: genDynamicImport(file, { interopDefault: true }) } })) } diff --git a/packages/schema/src/config/experimental.ts b/packages/schema/src/config/experimental.ts index d1507afa66..f3256e542d 100644 --- a/packages/schema/src/config/experimental.ts +++ b/packages/schema/src/config/experimental.ts @@ -34,10 +34,9 @@ export default { /** * Split server bundle into multiple chunks and dynamically import them * - * Note: Enabling this flag can cause hydration issues in some platform. * * @see https://github.com/nuxt/framework/issues/6432 */ - viteServerDynamicImports: false, + viteServerDynamicImports: true, } }