nextjs - 💡(How to fix) Fix Prefetching is broken with basePath [5 comments, 6 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#87682Fetched 2026-04-08 02:06:36
View on GitHub
Comments
5
Participants
6
Timeline
16
Reactions
8
Timeline (top)
commented ×5subscribed ×4labeled ×3closed ×1

Code Example

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:56 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6041
  Available memory (MB): 65536
  Available CPU cores: 16
Binaries:
  Node: 22.17.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.20.0
Relevant Packages:
  next: 16.1.1-canary.3 // Latest available version is detected (16.1.1-canary.3).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  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/poggiolabs/next-16-prefetch-bug

To Reproduce

  1. Visit https://next-16-prefetch-bug-git-main.next-16-preview.poggio.io/app
  2. Observe a 404 when prefetching https://next-16-prefetch-bug-git-narrow-repro.next-16-preview.poggio.io/app/test_slug

Current vs. Expected behavior

Expected: RSC prefetch requests should succeed with 200 status

Actual: RSC prefetch requests return 404 in preview deployments with custom domain suffix

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:56 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6041
  Available memory (MB): 65536
  Available CPU cores: 16
Binaries:
  Node: 22.17.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.20.0
Relevant Packages:
  next: 16.1.1-canary.3 // Latest available version is detected (16.1.1-canary.3).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

Linking and Navigating

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

Vercel (Deployed)

Additional context

The issue is also present on the latest canary: https://next-16-prefetch-bug-git-next-16-1-1.next-16-preview.poggio.io/app

I first saw this on the 16.0 release. It does not happen running locally with next start.

extent analysis

TL;DR

The issue with RSC prefetch requests returning 404 in preview deployments with custom domain suffix on Vercel can be addressed by adjusting the next.config.js file to handle custom domain suffixes.

Guidance

  • Review the next.config.js file to ensure it is properly configured for preview deployments with custom domain suffixes.
  • Verify that the target property in next.config.js is set to 'serverless' to enable serverless mode, which is required for RSC to work correctly.
  • Check the Vercel configuration to ensure that the custom domain suffix is correctly set up and propagated to the Next.js application.
  • Test the application with a different domain suffix or a non-preview deployment to isolate the issue.

Example

No code example is provided as the issue is related to configuration and deployment settings.

Notes

The issue seems to be specific to Vercel preview deployments with custom domain suffixes, and it does not occur when running the application locally with next start. This suggests that the issue is related to the deployment configuration rather than the application code itself.

Recommendation

Apply workaround: Adjust the next.config.js file to handle custom domain suffixes, as the issue is likely related to the configuration and deployment settings.

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

nextjs - 💡(How to fix) Fix Prefetching is broken with basePath [5 comments, 6 participants]