From d4166bc1622dc6eb337bc53ea5adfd42ea750901 Mon Sep 17 00:00:00 2001 From: easeurmind <64529155+restareaByWeezy@users.noreply.github.com> Date: Mon, 30 Mar 2026 18:53:16 +0900 Subject: [PATCH] fix(start): strip trailing slash from prerenderable paths inferFullPath preserves trailing slashes for index routes (e.g. /blog/) but the link crawler extracts paths without them (/blog). The seen Set treats these as distinct strings, so both get crawled and land in the sitemap as duplicates. Strip the trailing slash right after inferFullPath in getPrerenderablePaths so discovered paths match crawled ones. --- .../generator-plugins/prerender-routes-plugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/start-plugin-core/src/start-router-plugin/generator-plugins/prerender-routes-plugin.ts b/packages/start-plugin-core/src/start-router-plugin/generator-plugins/prerender-routes-plugin.ts index b614ae4afae..0c7c3f00269 100644 --- a/packages/start-plugin-core/src/start-router-plugin/generator-plugins/prerender-routes-plugin.ts +++ b/packages/start-plugin-core/src/start-router-plugin/generator-plugins/prerender-routes-plugin.ts @@ -31,7 +31,8 @@ function getPrerenderablePaths( // filter routes that do not have a component, i.e api routes if (!route.createFileRouteProps?.has('component')) continue - paths.add(inferFullPath(route)) + const fullPath = inferFullPath(route) + paths.add(fullPath === '/' ? fullPath : fullPath.replace(/\/$/, '')) } return Array.from(paths).map((path) => ({ path }))