TanStackT
TanStack12mo ago
3 replies
endless-jade

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

And the generated route tree looks like this:
/
/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
A trivia app for meetups. Contribute to nikolovlazar/trivius development by creating an account on GitHub.
GitHub - nikolovlazar/trivius at 48939a1989a36ff2728ce2f4f45f6c64c5...
Was this page helpful?