vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.06k stars 26.71k forks source link

after router.push() has two basePath url #51915

Open carlccy opened 1 year ago

carlccy commented 1 year ago

Verify canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64
    Binaries:
      Node: 16.14.2
      npm: 9.1.2
      Yarn: 1.22.18
      pnpm: N/A
    Relevant packages:
      next: 13.4.4
      eslint-config-next: 13.4.4
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.3

Which area(s) of Next.js are affected? (leave empty if unsure)

Routing (next/router, next/navigation, next/link)

Link to the code that reproduces this issue or a replay of the bug

npx create-next-app@latest

To Reproduce

http://localhost:3000/app/app/test

Describe the Bug

When i set basePath as '/app' router.push('/test') url become 'http://localhost:3000/app/app/test' has two '/app'

Expected Behavior

only one basePath

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

itsmenikhill commented 1 year ago

i'd like to work on this issue

carlccy commented 1 year ago

Would you like to use App Router? I chose 'Yes'.

Now I choose 'No' when reinstall. It's ok.