From bad0220bce2c9509d4305f60e39830fdbb2bda65 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 2 Nov 2022 11:55:58 -0400 Subject: [PATCH] fix: stringify values --- packages/nuxt/src/pages/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/pages/utils.ts b/packages/nuxt/src/pages/utils.ts index a01e15db055..3626d4976c3 100644 --- a/packages/nuxt/src/pages/utils.ts +++ b/packages/nuxt/src/pages/utils.ts @@ -240,8 +240,8 @@ export function normalizeRoutes (routes: NuxtPage[], metaImports: Set = return { ...Object.fromEntries(Object.entries(route).map(([key, value]) => [key, JSON.stringify(value)])), - name: `${metaImportName}?.name ?? ${route.name}`, - path: `${metaImportName}?.path ?? ${route.path}`, + name: `${metaImportName}?.name ?? ${route.name ? JSON.stringify(route.name) : 'undefined'}`, + path: `${metaImportName}?.path ?? ${JSON.stringify(route.path)}`, children: route.children ? normalizeRoutes(route.children, metaImports).routes : [], meta: route.meta ? `{...(${metaImportName} || {}), ...${JSON.stringify(route.meta)}}` : metaImportName, alias: aliasCode,