Skip to content

Router push loses locale with basePath  #905

Description

@Oberwaditzer

Description

If a basePath is configured in the nextConfig it gets lost with router.push. With a Link it works fine.

Mandatory reproduction URL

https://codesandbox.io/p/devbox/great-jerry-s6ylgc

Reproduction description

Steps to reproduce:

  1. Open reproduction
  2. You should be now on /base-path/de
  3. Click on Link
  4. you are now on /base-path/de/test-page
  5. go back
  6. Click on Router Push
  7. you are now on /base-path/test-page

Expected behaviour

If using router.push in combination with basePath the locale should also be carried with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingunconfirmedNeeds triage.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions