diff --git a/packages/nuxt3/src/pages/utils.ts b/packages/nuxt3/src/pages/utils.ts index 8d01d12024..42adf09586 100644 --- a/packages/nuxt3/src/pages/utils.ts +++ b/packages/nuxt3/src/pages/utils.ts @@ -237,7 +237,7 @@ export function normalizeRoutes (routes: NuxtPage[], metaImports: Set = ...Object.fromEntries(Object.entries(route).map(([key, value]) => [key, JSON.stringify(value)])), children: route.children ? normalizeRoutes(route.children, metaImports).routes : [], meta: route.meta ? `{...(${metaImportName} || {}), ...${JSON.stringify(route.meta)}}` : metaImportName, - alias: `${metaImportName}.alias || []`, + alias: `${metaImportName}?.alias || []`, component: genDynamicImport(file) } }))