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

redirect not honoring basePath #53713

Closed
1 task done
aryobenholzner opened this issue Aug 8, 2023 · 3 comments
Closed
1 task done

redirect not honoring basePath #53713

aryobenholzner opened this issue Aug 8, 2023 · 3 comments
Labels
bug Issue was opened via the bug report template. Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. locked

Comments

@aryobenholzner
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
    Binaries:
      Node: 16.17.0
      npm: 8.15.0
      Yarn: 1.22.19
      pnpm: 7.1.0
    Relevant Packages:
      next: 13.4.14-canary.0
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.3
    Next.js Config:
      output: N/A

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

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

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

https://codesandbox.io/p/sandbox/gifted-forest-8kjr9w?file=%2Fnext.config.js%3A9%2C1

To Reproduce

  • add a basePath to next.config.js (e.g. /base-path)
  • add a next/navigation redirect to another page to a server page (e.g. redirect('/sub-path'))

Describe the Bug

the URL changed to a path without including the basePath, resulting in Error 404

Expected Behavior

like with Link from next/link, the base path should be prepended

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

@aryobenholzner aryobenholzner added the bug Issue was opened via the bug report template. label Aug 8, 2023
@github-actions github-actions bot added the Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. label Aug 8, 2023
@aryobenholzner aryobenholzner changed the title redirect not redirect not honoring basePath Aug 8, 2023
@ajaykrathod

This comment was marked as resolved.

@aryobenholzner
Copy link
Author

duplicated issue #54163

fixed in #54277

@github-actions
Copy link
Contributor

github-actions bot commented Sep 6, 2023

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot added the locked label Sep 6, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. Linking and Navigating Related to Next.js linking (e.g., <Link>) and navigation. locked
Projects
None yet
Development

No branches or pull requests

2 participants