Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/prerender-trailing-slash-query.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@tanstack/start-plugin-core': patch
---

fix(start-plugin-core): keep the prerender trailing slash off the query string

The crawler applied `withTrailingSlash` to the full path including the query string, so the slash landed inside the last search-param value and, with `crawlLinks` enabled, sent the crawl into an infinite loop. Passing ufo's `respectQueryAndFragment` flag keeps the slash on the path.
2 changes: 1 addition & 1 deletion packages/start-plugin-core/src/prerender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export async function prerender({

try {
const res = await requestWithRedirects(
withTrailingSlash(withBase(page.path, routerBasePath)),
withTrailingSlash(withBase(page.path, routerBasePath), true),
{
headers: {
...(prerenderOptions.headers ?? {}),
Expand Down