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

[Bug]: Basename is duplicated in nested routes #10467

Closed
fkaempfer opened this issue May 9, 2023 · 7 comments · Fixed by #10492
Closed

[Bug]: Basename is duplicated in nested routes #10467

fkaempfer opened this issue May 9, 2023 · 7 comments · Fixed by #10492
Labels

Comments

@fkaempfer
Copy link

fkaempfer commented May 9, 2023

What version of React Router are you using?

6.11.1

Steps to Reproduce

This seems similar to #10431 , but I'm unsure whether this is a regression, since I only recently switched to vite.

In particular scenarios with nested routes it happens that the basename is duplicated. I managed to create an example here:
https://stackblitz.com/edit/github-cjtxux?file=src/App.tsx
https://githubcjtxux-uvj1--5173--9c984a48.local-corp.webcontainer.io/test/test/dashboard

  • Click on Dashboard -> Dashboard is loaded fine
  • Click on About which contains a nested route to dashboard
  • Click on Dashboard link on the bottom -> Dashboard link is not resolved (Nothing to see here), the URL contains the basename twice (/test/test/dashboard)

Expected Behavior

Clicking the link on the about page should load the dashboard page

Actual Behavior

Clicking the link on the about page loads the 404 page

@fkaempfer fkaempfer added the bug label May 9, 2023
@nonameolsson
Copy link

I can agree with this bug report. The same behaviour is happening for us.

@brophdawg11
Copy link
Contributor

Thanks for the reproduction @fkaempfer! This does look like a regression in 6.11.1 so we'll get a fix out in a patch release soon.

@brophdawg11 brophdawg11 self-assigned this May 9, 2023
@hasan-wajahat
Copy link

I also saw this issue in our project. But this is introduced only in 6.11, it worked as expected when I downgraded to 6.10.

@brophdawg11 brophdawg11 added the awaiting release This issue have been fixed and will be released soon label May 16, 2023
@brophdawg11 brophdawg11 removed their assignment May 16, 2023
@brophdawg11
Copy link
Contributor

This is fixed by #10492 and will be available once 6.11.2 is released 👍

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 6.11.2-pre.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@fkaempfer
Copy link
Author

Thanks, it seems to fix the issue in my app.

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 6.11.2 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@brophdawg11 brophdawg11 removed the awaiting release This issue have been fixed and will be released soon label Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants