Skip to content

throw redirect in beforeLoad with rewriteBasePath ignores the rewrite #5300

@omridevk

Description

@omridevk

Which project does this relate to?

Router

Describe the bug

it cannot easily be reproduced in stackblitz, however, I forked and create a repo in the examples:
5d32b97
to reproduce:

  1. Run basic-ssr-streaming-file-based
  2. Go to http://localhost:3000/my-app/posts/2
  3. Notice it is being redirected to http://localhost:3000/error

This only happens when the beforeLoad happens on the server, if you set the SSR to false on the component that throws the redirect, the issue doesn't happen.

Expected: it should redirect to http://localhost:3000/my-app/error

I will try to create a PR, not sure I will have the capacity this week,
Thanks for the quick response!!

Your Example Website or App

5d32b97

Steps to Reproduce the Bug or Issue

  1. Run basic-ssr-streaming-file-based
  2. Go to http://localhost:3000/my-app/posts/2
  3. Notice it is being redirected to http://localhost:3000/error

Expected behavior

Expected: it should redirect to http://localhost:3000/my-app/error

Screenshots or Videos

No response

Platform

  • Router / Start Version: [e.g. 1.121.0]
  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Browser Version: [e.g. 91.1]
  • Bundler: [e.g. vite]
  • Bundler Version: [e.g. 7.0.0]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions