-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Which project does this relate to?
Router
Describe the bug
When using a basepath (e.g., /app), calling redirect() appends the basepath again to the URL, resulting in an incorrect URL and a notFoundError.
Ex:
It should redirect to /app/private/$privateId
But it is redirecting to /app/app/private/$privateId
Note:
Redirect works fine without the basepath
i.e
Redirecting to /private/$privateId works fine
Your Example Website or App
https://stackblitz.com/edit/github-sagxavol?file=src%2Froutes%2Findex.tsx
Steps to Reproduce the Bug or Issue
- Open the given reproduction link
- Set the router base path to /app.
- Navigate to /app/private.
- This route triggers a redirect to /app/private/$privateId.
Expected behavior
The redirect should navigate to /app/private/$privateId without duplicating the base path.
but
The redirect navigates to /app/app/private/$privateId, causing a notFoundError.
Screenshots or Videos
No response
Platform
- Router [version 1.132.27]
Additional context
rowanhen, Amko94, jakst and vanquishkuso
Metadata
Metadata
Assignees
Labels
No labels