nextjs - 💡(How to fix) Fix RSC endpoints always return 404 when deployed on Vercel [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#85349Fetched 2026-04-08 02:16:15
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
closed ×1commented ×1issue_type_added ×1labeled ×1

Code Example

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 65460
  Available CPU cores: 24
Binaries:
  Node: 22.15.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.11.1
Relevant Packages:
  next: 16.0.0
  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://createmytoken-v2-l0hlfg9lt-metacrypt.vercel.app/

To Reproduce

This only happens when you deploy the app on Vercel, can't reproduce this locally. (Hence the provided reproduction link is a Vercel preview)

This happens with both Turbopack and Webpack.

Current vs. Expected behavior

RSC prefetch should work as expected whereas it currently does not.

These are all the prefetches that happen when you land on the page, all return 404 whereas locally they return the correct React fragment.

<img width="921" height="300" alt="Image" src="https://github.com/user-attachments/assets/621e7964-b6e2-4780-8e09-35281c64c7b7" />

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 65460
  Available CPU cores: 24
Binaries:
  Node: 22.15.0
  npm: 10.9.2
  Yarn: N/A
  pnpm: 10.11.1
Relevant Packages:
  next: 16.0.0
  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)

Not sure

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

Vercel (Deployed)

Additional context

Tested against latest canary as well.

extent analysis

TL;DR

The issue with RSC prefetch not working as expected on Vercel deployment may be resolved by configuring the next.config.js file to handle prefetching correctly for the specific environment.

Guidance

  • Verify that the next.config.js file is properly configured for Vercel deployment, checking for any environment-specific settings that might affect prefetching.
  • Check the Vercel configuration to ensure that it is set up to handle React Server Components (RSC) and prefetching as expected.
  • Review the network requests for the prefetches to confirm that the URLs being requested are correct and should not return 404 errors.
  • Consider testing with a minimal reproduction case to isolate the issue and determine if it's specific to the current project setup or a more general problem with RSC prefetching on Vercel.

Example

No specific code example can be provided without more details on the current next.config.js setup and the exact prefetch URLs being requested.

Notes

The issue seems to be environment-specific (Vercel vs. local), which suggests that the configuration or setup might be the key to resolving the problem. Without more information on the project's configuration files and the exact behavior of the prefetch requests, it's challenging to provide a precise solution.

Recommendation

Apply workaround: Given the environment-specific nature of the issue, applying a workaround that involves adjusting the next.config.js for Vercel deployment or modifying how prefetching is handled in the React application might be necessary until a more permanent fix can be identified.

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 RSC endpoints always return 404 when deployed on Vercel [1 comments, 2 participants]