Skip to content

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

@fkaempfer

Description

@fkaempfer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions