-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Which project does this relate to?
Router
Describe the bug
I'm falling into an infinite redirect loop using the following directory structure:
├── src/
│ ├── routes/
│ │ ├── {-$locale}/
│ │ │ ├── index.tsx
│ │ │ └── route.tsx
│ │ └── `__root.tsx`
Not posting codesandbox link here beacause it breaks the browser
Your Example Website or App
https://github.com/SashkaHavr/tsrouter-optional-path-params-repro
Steps to Reproduce the Bug or Issue
pnpm install
pnpm dev
- Visit http://localhost:3000/
- Look at server console output
Result: "render /{-$locale}/route.tsx" is infinitelly spammed in console and page is never opened
Expected behavior
Index page with default locale is opened
Screenshots or Videos
No response
Platform
- Router / Start Version: 1.128.4/1.128.5
- OS: Windows
- Browser: Chrome
- Bundler: vite
- Bundler Version: 7.0.5
Additional context
Workaround:
- Move
beforeLoad
from/src/routes/{-$locale}/route.tsx
into/src/routes/{-$locale}/index.tsx
- Delete
/src/routes/{-$locale}/route.tsx
Result: Index page with default locale is opened
Metadata
Metadata
Assignees
Labels
No labels