T
TanStack8mo ago
genetic-orange

Trailing slash when SSR, otherwise it's ignored

I have a route config that looks like this:
routes/
├── app/
│ ├── games/
│ │ └── $gameId/
│ │ └── index.tsx
│ ├── index.tsx
│ └── route.tsx
├── __root.tsx
├── _auth.signup.tsx
├── _auth.signin.tsx
├── _auth.tsx
└── index.tsx
routes/
├── app/
│ ├── games/
│ │ └── $gameId/
│ │ └── index.tsx
│ ├── index.tsx
│ └── route.tsx
├── __root.tsx
├── _auth.signup.tsx
├── _auth.signin.tsx
├── _auth.tsx
└── index.tsx
And the generated route tree looks like this:
/
/app
/app/games/$gameId
/signup
/signin
/
/app
/app/games/$gameId
/signup
/signin
The issue I'm experiencing is with /app. If I soft-navigate from /signin there is no trailing slash, but if I hit refresh in the browser the URL turns into /app/. I'm guessing it's because of the index.tsx inside of the app folder, but I have set the trailingSlashes option to 'never' in the createRouter function. Is this expected? GitHub repo for reproduction: https://github.com/nikolovlazar/trivius/tree/48939a1989a36ff2728ce2f4f45f6c64c5efd43a
GitHub
GitHub - nikolovlazar/trivius at 48939a1989a36ff2728ce2f4f45f6c64c5...
A trivia app for meetups. Contribute to nikolovlazar/trivius development by creating an account on GitHub.
3 Replies
foreign-sapphire
foreign-sapphire8mo ago
can you please create a github issue for this?
genetic-orange
genetic-orangeOP8mo ago
yep! thanks for replying!
genetic-orange
genetic-orangeOP8mo ago
GitHub
Trailing slash when SSR, otherwise ignored · Issue #3281 · TanStack...
Which project does this relate to? Router Describe the bug I have a route config that looks like this: routes/ ├── app/ │ ├── games/ │ │ └── $gameId/ │ │ └── index.tsx │ ├── index.tsx │ └── route.t...

Did you find this page helpful?