nextjs - 💡(How to fix) Fix Proxy issues when basePath is set [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#86701Fetched 2026-04-08 02:09:44
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
1
Timeline (top)
labeled ×2commented ×1issue_type_added ×1subscribed ×1

Code Example

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 16299
  Available CPU cores: 16
Binaries:
  Node: 22.21.1
  npm: 10.9.4
  Yarn: N/A
  pnpm: 10.24.0
Relevant Packages:
  next: 16.1.0-canary.9 // Latest available version is detected (16.1.0-canary.9).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/Verge-One/nextjs-proxy-bug

To Reproduce

  1. Start the app in dev
  2. Navigate to /invoice

Current vs. Expected behavior

When navigating to /invoice, i expect to be redirected to /invoice/signup. However it doesnt redirect me. i used the proxy matcher from the nextjs docs. when using "/" for the matcher everything works fine. but the default matcher excluding only nextjs assets etc doesnt work. i feel like its an issue with the matcher when the basePath is set.

Sometimes i even get the log: "redirecting to /invoice/signin" but it just doesnt happen. when navigating to /invoice/signin directly it works, so the matcher excludes that page.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 16299
  Available CPU cores: 16
Binaries:
  Node: 22.21.1
  npm: 10.9.4
  Yarn: N/A
  pnpm: 10.24.0
Relevant Packages:
  next: 16.1.0-canary.9 // Latest available version is detected (16.1.0-canary.9).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Middleware, Redirects

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

extent analysis

TL;DR

  • Verify the proxy matcher configuration in next.config.js to ensure it correctly handles the basePath setting.

Guidance

  • Review the next.config.js file to confirm the proxy matcher is correctly set up, especially when using a basePath.
  • Check the Next.js documentation for the correct syntax and usage of the proxy matcher with basePath.
  • Test the proxy matcher with a simpler configuration to isolate the issue.
  • Verify that the basePath setting is correctly applied in the next.config.js file.

Example

No code example is provided due to the lack of specific configuration details in the issue.

Notes

  • The issue might be specific to the next dev stage or the basePath setting, so testing with different configurations or stages may help isolate the problem.
  • The provided environment information and package versions may not be directly related to the issue, but it's essential to ensure that the Next.js version and configuration are compatible.

Recommendation

  • Apply workaround: Verify and adjust the proxy matcher configuration to ensure compatibility with the basePath setting, as the issue seems to be related to the configuration rather than a version-specific problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING