nextjs - 💡(How to fix) Fix Suspense getting stuck sometimes on production with infinite fallbacks [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#88286Fetched 2026-04-08 02:05:10
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
closed ×1commented ×1issue_type_added ×1labeled ×1

Error Message

Its a bit tricky to reproduce and locally works. But sometimes after switching pages on the sidebar multiple times, nextjs won't render data inside of suspense boundary (3 of them) it would just show 3 loaders running indefinetly, until something causes a rerender (like sidebar shrink action for example, or search). All of the compnents inside the Suspense are client components. I first thought this was a hydration error, so I put multiple suppress booleans, but none helped. This occurs from time to time and only on prod (using VPS with Coolify). I am using the approach of consuming the headers from the component on one level below, but still I get the error. And something hydration error appears in the console, even tho I am using client components between these suspenses. Any ideas?

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): 24576
  Available CPU cores: 12
Binaries:
  Node: 22.18.0
  npm: 10.9.3
  Yarn: 1.22.22
  pnpm: 10.24.0
Relevant Packages:
  next: 16.1.1 // Latest available version is detected (16.1.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
 cacheComponents: true,
  experimental: {
    serverActions: {
      bodySizeLimit: "15mb",
    },
  },
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://gist.github.com/danesto/3c384f552ecaf2957ed1b1f55d86cf83

To Reproduce

Its a bit tricky to reproduce and locally works. But sometimes after switching pages on the sidebar multiple times, nextjs won't render data inside of suspense boundary (3 of them) it would just show 3 loaders running indefinetly, until something causes a rerender (like sidebar shrink action for example, or search). All of the compnents inside the Suspense are client components. I first thought this was a hydration error, so I put multiple suppress booleans, but none helped. This occurs from time to time and only on prod (using VPS with Coolify).

Current vs. Expected behavior

Suspense is stuck on loading until rerender Should display data

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): 24576
  Available CPU cores: 12
Binaries:
  Node: 22.18.0
  npm: 10.9.3
  Yarn: 1.22.22
  pnpm: 10.24.0
Relevant Packages:
  next: 16.1.1 // Latest available version is detected (16.1.1).
  eslint-config-next: N/A
  react: 19.2.0
  react-dom: 19.2.0
  typescript: 5.9.3
Next.js Config:
 cacheComponents: true,
  experimental: {
    serverActions: {
      bodySizeLimit: "15mb",
    },
  },

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

cacheComponents

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

Other (Deployed)

Additional context

I am using the approach of consuming the headers from the component on one level below, but still I get the error. And something hydration error appears in the console, even tho I am using client components between these suspenses. Any ideas?

  • Happens on prod only, locally I can't reproduce it

Heres my code snippet:

<img width="524" height="675" alt="Image" src="https://github.com/user-attachments/assets/0fcc3508-f4b7-4e55-bc77-7580ef3bab30" />

extent analysis

TL;DR

  • The issue might be related to the cacheComponents configuration in Next.js, and disabling it or adjusting the caching strategy could potentially resolve the problem.

Guidance

  • Review the cacheComponents configuration and consider disabling it to see if it resolves the issue, as it's currently set to true and is an affected area.
  • Investigate the server-side rendering and hydration process to ensure that the components inside the Suspense boundary are being properly rendered and hydrated.
  • Check the console logs for any errors or warnings related to hydration or rendering, and verify that the components are being rendered correctly on the server-side.
  • Consider adding additional logging or debugging statements to help reproduce the issue and identify the root cause.

Example

  • No code snippet is provided as the issue doesn't contain a clear code example that can be used to reproduce the issue.

Notes

  • The issue is only reproducible in production, which makes it harder to debug and identify the root cause.
  • The cacheComponents configuration is a potential culprit, but disabling it might have performance implications and should be thoroughly tested.

Recommendation

  • Apply workaround: Disable cacheComponents and monitor the application's performance to see if it resolves the issue, as it's a potential cause and the issue is only reproducible in production.

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 Suspense getting stuck sometimes on production with infinite fallbacks [1 comments, 2 participants]