diff --git a/packages/core/package.json b/packages/core/package.json index 28d9dc70d..2dc6362bf 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -40,6 +40,9 @@ }, "./_private/react": { "default": "./dist/_private/react/index.js" + }, + "./_private/RouteService": { + "default": "./dist/_private/RouteService/index.js" } }, "main": "./dist/index.js", diff --git a/packages/core/src/node/route/RoutePage.ts b/packages/core/src/node/route/RoutePage.ts index 77211f21f..45f871e54 100644 --- a/packages/core/src/node/route/RoutePage.ts +++ b/packages/core/src/node/route/RoutePage.ts @@ -74,6 +74,13 @@ function absolutePathToRouteMeta( const { lang, routePath, version } = routeService.normalizeRoutePath(relativePath); + + if (!routeService.isExistRoute(routePath)) { + throw new Error( + `The routePath "${routePath}" derived from the file "${absolutePath}" does not exist in the route service.`, + ); + } + return { pageName: getPageKey(relativePath), absolutePath,