-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Which project does this relate to?
Router
Describe the bug
Router does not render index.tsx in a dynamic path parameter route that comes after an optional path parameter.
Your Example Website or App
https://github.com/kanasva/tanstack-router-example-basic-file-based-optional-path-param-issue
Steps to Reproduce the Bug or Issue

Case 1 Not use optional path param: It works as expected.
locale
is a dynamic path parameter.
tenantId
is a dynamic path parameter.
/not-use-optional/locale
: Works/not-use-optional/locale/tenantId
: Works/not-use-optional/locale/tenantId/settings
: Works
Case 2 Use optional path param: It doesn't work as expected.
locale
is an optional path parameter.
tenantId
is a dynamic path parameter.
/use-optional/locale
: Works/use-optional/locale/tenantId
: Doesn't work, render blank page./use-optional/locale/tenantId/settings
: Works
Expected behavior
/use-optional/locale/tenantId
should render {-$locale}.$tenantId.index.tsx
Screenshots or Videos
No response
Platform
{
"dependencies": {
"@tanstack/react-router": "^1.131.5",
"@tanstack/react-router-devtools": "^1.131.5",
"@tanstack/router-plugin": "^1.131.5",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"redaxios": "^0.5.1",
"postcss": "^8.5.1",
"autoprefixer": "^10.4.20",
"tailwindcss": "^3.4.17",
"zod": "^3.24.2"
},
"devDependencies": {
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.3.4",
"typescript": "^5.7.2",
"vite": "^6.3.5"
}
}
Additional context
No response