Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing slash when SSR, otherwise ignored #3281

Open
nikolovlazar opened this issue Jan 30, 2025 · 0 comments
Open

Trailing slash when SSR, otherwise ignored #3281

nikolovlazar opened this issue Jan 30, 2025 · 0 comments

Comments

@nikolovlazar
Copy link

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.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: https://github.com/nikolovlazar/trivius/tree/48939a1989a36ff2728ce2f4f45f6c64c5efd43a

Your Example Website or App

https://stackblitz.com/edit/github-vajjdgwa?file=app%2Froutes%2Fapp%2Findex.tsx

Steps to Reproduce the Bug or Issue

  1. Click on the link in the / page that takes you to /app
  2. Note the URL: ends with /app - no trailing slash
  3. Hit refresh and note the URL: ends with /app/ with a trailing slash

Expected behavior

Hard-navigating to the /app page should not add a trailing slash at the end.

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Brave
  • Version: 1.74.51

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant