Skip to content

v1.132.2 basePath is not working for browser url #5200

Description

@leesb971204

Which project does this relate to?

Router

Describe the bug

Since that version, basepath has been replaced with the rewrite method, and it seems that the rewrite logic has been applied to basepath for backward compatibility with previous versions.

When basepath is configured the same way as in earlier versions, accessing without a basepath (e.g., http://localhost:3000) does not add the basepath to the browser URL.

Your Example Website or App

https://stackblitz.com/edit/github-lebazlff?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

  1. check window.location.pathname in /home
  2. click about
  3. check window.location.pathname in /about

Expected behavior

window.location.pathname in home should be /app

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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