diff --git a/packages/nuxt/src/pages/utils.ts b/packages/nuxt/src/pages/utils.ts index 19014fbd20..78080c97cc 100644 --- a/packages/nuxt/src/pages/utils.ts +++ b/packages/nuxt/src/pages/utils.ts @@ -139,12 +139,12 @@ export function generateRoutesFromFiles (files: ScannedFile[], options: Generate return prepareRoutes(routes) } -export async function augmentPages (routes: NuxtPage[], vfs: Record, augmentedPages = new Set()) { +export async function augmentPages (routes: NuxtPage[], vfs: Record, augmentedPages = new Set()) { for (const route of routes) { - if (!augmentedPages.has(route) && route.file) { + if (route.file && !augmentedPages.has(route.file)) { const fileContent = route.file in vfs ? vfs[route.file] : fs.readFileSync(await resolvePath(route.file), 'utf-8') Object.assign(route, await getRouteMeta(fileContent, route.file)) - augmentedPages.add(route) + augmentedPages.add(route.file) } if (route.children && route.children.length > 0) {