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 not respected in loaders and actions redirects #9417

Closed
manzano78 opened this issue Oct 6, 2022 · 2 comments · Fixed by #9447
Closed

[Bug]: Basename is not respected in loaders and actions redirects #9417

manzano78 opened this issue Oct 6, 2022 · 2 comments · Fixed by #9447
Labels

Comments

@manzano78
Copy link
Contributor

manzano78 commented Oct 6, 2022

What version of React Router are you using?

6.4.1

Steps to Reproduce

  1. Create a data browser router with some routes and a basename: createBrowserRouter(routes, { basename: '/m' });
  2. In any route, attach a loader or an action (both are impacted) which returns or throws (both are impacted) a redirect to another route represented by an absolute path: throw redirect('/some-route');

Expected Behavior

The new browser URL should be https://example.com/m/some-route

Actual Behavior

The new browser URL is https://example.com/some-route. The basename (/m) is missing, so we don't see the expected page as it couldn't match.

@brophdawg11
Copy link
Contributor

Just merged the PR for this, hoping to get a 6.4.3 prerelease out soon (possibly today) and a stable hopefully next week 👍

@brophdawg11
Copy link
Contributor

👋 Just did a prerelease (6.4.3-pre.0) which should fix this if you want to give it a shot!

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.

2 participants