Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
Client UI doesn't update after revalidatePath with Suspense and short promise | GoodFirstPicks

Client UI doesn't update after revalidatePath with Suspense and short promise

vercel/next.js 1 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

The issue involves complex Suspense and revalidation timing interactions in production mode.

AI Summary

The UI fails to update after revalidatePath when a short-duration promise exists in Suspense, but works correctly without it. The bug appears production-only and requires understanding of Suspense behavior and Next.js revalidation. The reproduction steps are clear but the fix likely involves React's streaming or hydration timing.

Issue Description

Link to the code that reproduces this issue

https://github.com/TomLaVachette/next-short-promise-issue

To Reproduce

  1. Clone the repository and run npm install && npm run build && npm run start (⚠️ bug appears only in production mode)
  2. Open http://localhost:3000 in your browser
  3. Open the browser DevTools console to see client logs, and watch the terminal for server logs
  4. Click the "Increment" button (multiple time if needed)
  5. Observe the bug: The UI still shows counter: 0 even though:
  • Server logs show [Server Component] Rendering Home with counter: 1
  • Client logs show [Client Component] Rendering ClientComponent with counter: 1
  1. Click the "Toggle" button (which triggers a useState update)
  2. Observe: The counter now correctly displays 1

To verify the fix: Comment out the block in app/page.tsx (lines 25-27). The counter will now update correctly after clicking "Increment".

https://github.com/user-attachments/assets/10f90744-9b14-471a-8cbc-b5ed91cdb2ea

Current vs. Expected behavior

Current behavior: When a server action calls revalidatePath('/') on a page containing a very short async component (<5ms) wrapped in Suspense, the client UI does not update to reflect the new server state. The console logs prove that:

  • The server action completes successfully
  • The server re-renders the page with the updated counter value
  • The client component receives and logs the new counter value

Yet the DOM is not updated. The UI remains "stuck" showing stale data until any client-side state change (like toggling a useState) forces a re-render.

Expected behavior: After revalidatePath('/') completes, the client UI should update to display the new counter value (e.g., counter: 1) without requiring any manual intervention or client-side state change.

Key observation: The bug only occurs when a short-duration promise (~5ms) exists in a Suspense boundary. Removing the WaitingPromise component resolves the issue.

GitHub Labels

ReactLoading UI and Streaming

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • Suspense behavior
  • production-only bug
  • timing-sensitive
Loading labels...

Details

Points10 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno