Start SSR enters infinite 307 loop when custom search serializer emits comma-delimited arrays
Los mantenedores suelen responder en 1 día
@pavstev ya está trabajando en esto.
Desde el 3/11/2026.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 57/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- backend
Línea de trabajo
Start in the loadServerRoute and getNormalizedURL code paths described in the issue, then compare how each constructs and compares the request URL for comma and %2C query values. Use the linked StackBlitz reproduction or the provided curl command to observe the repeated 307 redirects. Done means the request converges without redirecting forever, including when the router's rewrite option is used.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Which project does this relate to?
Router
Describe the bug
TanStack Start SSR can enter an infinite self-redirect loop when a custom stringifySearch emits comma-delimited arrays.
For GET /test?tags=1,2, server URL normalization serializes the query as tags=1%2C2. The configured parser and route's validateSearch turn this into tags: ['1', '2'], then the configured stringifier canonicalizes it back to the literal-comma form, /test?tags=1,2.
loadServerRoute compares the normalized next.publicHref with the canonical publicHref, sees %2C and , as different, and redirects to canonical publicHref with 307 Location: /test?tags=1,2. The redirected request repeats the same process indefinitely. Browser show ERR_TOO_MANY_REDIRECTS.
Complete minimal reproducer
https://stackblitz.com/edit/github-tnsncrms-xorkcit6?file=src%2Frouter.tsx
Steps to Reproduce the Bug
- Visit reproduction link https://stackblitz.com/edit/github-tnsncrms-xorkcit6?file=src%2Frouter.tsx
- Click the link in the landing page to navigate to
/test?tags=1,2 - Observe "redirected you too many times" error in browser and document response:
HTTP/1.1 307
Location: /test?tags=1,2
Reproducible with curl:
4. Open new terminal in sandbox
5. Run curl -sL --max-redirs 3 'http://localhost:3000/test?tags=1,2'
6. Observe curl exits with: curl: (47) Maximum (3) redirects followed
Expected behavior
The request should converge—ideally return 200 for /test?tags=1,2; at minimum it must not redirect to the identical public URL forever.
Equivalent encodings of a query value, such as , and %2C, should not cause a canonicalization redirect
Screenshots or Videos
No response
Platform
@tanstack/react-router:1.170.45@tanstack/react-start:1.169.3- React:
19.3.1 - Node:
22.16.0 - OS: macOS 15.6 (Darwin 24.6.0)
- Bundler: Vite
8.3.4 - Browser: any; reproducible with
curl
Additional context
getNormalizedURL rebuilds the query with URLSearchParams(...).toString(), which encodes , as %2C, before loadServerRoute compares next.publicHref with the serializer's canonical output.
Workaround:
Split parsed params by comma in stringifySearch: Request search string is ?tags=1,2, after server normalization becomes ?tags=1%2C2, in stringifySearch is is parsed into { 'tags' : '1,2' }, after splitting { 'tags' : ['1', '2'] }
This is not a proper solution, but a way to mitigate the redirect loop while keeping the functionality as close as possible. It splits already escaped characters ?tag=1%2C2,3&input=foo%2Cbar -> { tags: ['1', '2', '3'], input: ['foo', 'bar'] } which is undesired.
This workaround doesn't work when rewrite option is provided in router. In that case stringifySearch doesn't affect the publicHref which is built from the history's href (see code) and SSR enters the infinite redirect loop.
- Lenguaje dominante
- TypeScript
- Estrellas
- 15.3k
- Forks
- 1.9k
- Merge medio
- 1 d 5 h
- PR fusionados (30 d)
- 46
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/router
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Masked navigation drops the first character of the hash each time (__tempLocation hash missing '#')Posiblemente ocupada @hassanabrar202 la tomó hace 8 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
router-generator: lazy-load Prettier (costs ~300–450ms per build even when formatting is off)Posiblemente ocupada @Sheraff la tomó hace 27 días. Abiertopackage: router-generator performance
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
router-generator: sibling `physical()` subtrees in a virtual route config generate duplicate identifiersPosiblemente ocupada @Sheraff la tomó hace 27 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
docs(router): clarify static title fallback in SPA modePosiblemente ocupada @Rohan-Dedhia la tomó hace 17 días. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/router
Issues similares
-
[BUG]: Shared links drop the configured basePath on GitHub PagesPosiblemente ocupada @anshulchikhale30-p la tomó hoy. Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
StabilityNexus/IdentityTokens-EVM-Frontend#182 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Add: GTrekkerAbiertocheck:passed streams:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Koenkk/zigbee-herdsman-converters#13900 ·
Los mantenedores suelen responder en 1 día
-
area: ui Bug Payload OSS
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
payloadcms/payload#19839 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
jeanibarz/knowledge-base-mcp-server#1291 ·
Los mantenedores suelen responder en 1 día