From 1f719be5dd42d038dadd7d01538b24212f7709c3 Mon Sep 17 00:00:00 2001 From: Pavel Kuzmin Date: Fri, 18 Oct 2024 00:18:11 +0500 Subject: [PATCH] fix: page.name warning --- src/page-manager.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/page-manager.ts b/src/page-manager.ts index 032a4786..9fd60ce3 100644 --- a/src/page-manager.ts +++ b/src/page-manager.ts @@ -46,6 +46,10 @@ export class PageManager { const additionalRoutes: NuxtPage[] = [] pages.forEach((page) => { + if (!page.name) { + console.warn(`[nuxt-i18n-next] Page name is missing for the file: ${page.file}`) + return + } const customRoute = this.globalLocaleRoutes[page.name ?? ''] ?? null // If globalLocaleRoutes for this page is false, skip localization