Skip to content

Commit ee4aaa3

Browse files
committed
fix: remove custom route config not found warning
1 parent cf134d9 commit ee4aaa3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/pages.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const i18nPathToPath = ${JSON.stringify(routeResources.i18nPathToPath, nu
7575

7676
// analyze layer pages
7777
for (const layer of nuxt.options._layers) {
78-
const pagesDir = resolve(projectLayer!.config.rootDir, layer.config.srcDir, layer.config.dir?.pages ?? 'pages')
78+
const pagesDir = resolve(projectLayer.config.rootDir, layer.config.srcDir, layer.config.dir?.pages ?? 'pages')
7979
analyzeNuxtPages(ctx, pagesDir, pages)
8080
}
8181

@@ -276,7 +276,7 @@ export function getRouteOptionsResolver(
276276
const res = getRouteOptions(route, localeCodes, ctx, defaultLocale, customRoutes)
277277
if (route.file) {
278278
const localeCfg = res?.srcPaths
279-
const mappedPath = ctx.fileToPath[route.file]!
279+
const mappedPath = ctx.fileToPath[route.file]
280280
ctx.pathToConfig[mappedPath] ??= {} as Record<string, string | boolean>
281281

282282
// set paths for all locales, assume no custom path is a disabled locale
@@ -306,7 +306,6 @@ function getRouteFromConfig(
306306
const pageMeta = ctx.pages.get(route.file!)
307307

308308
if (pageMeta == null) {
309-
console.warn(`[nuxt-i18n] No custom route config found for ${route.path}`)
310309
return undefined
311310
}
312311

0 commit comments

Comments
 (0)