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 }))