Skip to content

Fix useDeferredValue getting stuck - #36134

Merged
gaearon merged 3 commits into
mainfrom
fix-udv-stall
Mar 24, 2026
Merged

Fix useDeferredValue getting stuck#36134
gaearon merged 3 commits into
mainfrom
fix-udv-stall

Conversation

@gaearon

Copy link
Copy Markdown
Collaborator

Fixes#35821

Written/debugged by Claude.

Test Plan

@gaearon
gaearon requested a review from acdliteMarch 24, 2026 00:41
@github-actionsgithub-actionsBot added the React Core Team Opened by a member of the React Core Team label Mar 24, 2026
@react-sizebot

Copy link
Copy Markdown

Comparing: ed69815...df5ef86

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js+0.01%612.81 kB612.88 kB=108.29 kB108.30 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=678.75 kB678.81 kB=119.25 kB119.26 kB
facebook-www/ReactDOM-prod.classic.js=698.14 kB698.20 kB=122.65 kB122.65 kB
facebook-www/ReactDOM-prod.modern.js=688.45 kB688.52 kB=121.02 kB121.03 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against df5ef86

@acdliteacdlite left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Is it a good or a bad thing that there was already a TODO that (sorta) described the issue 😆

Discussed out-of-band, writing here for posterity:

The TODO I think is still correct, we should generalize that special-error-to-unwind-the-stack trick thing that we use for selective hydration. The main benefit is that if you're mid render it can restart immediately instead of burning cycles on a work-in-progress render that will inevitably get thrown out regardless. Leaving for a future PR in case we were to accidentally introduce a new bug in the progress.

@gaearon
gaearon merged commit c0d218f into mainMar 24, 2026
245 checks passed
@gaearon
gaearon deleted the fix-udv-stall branch March 24, 2026 00:49
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
dhernz added a commit to dhernz/watcher-protocol that referenced this pull request May 1, 2026
- server.ts: viem-based USDC tipping on Base mainnet from EconomyOS-provisioned wallet
- Claude reasoning step: agent decides tip amount or skip with one-line rationale
- PagerDuty REST integration: fetch incidents, find linked PR, post note with tx hash
- GitHub REST: PR author lookup
- new endpoints: POST /demo/run · GET /api/agent · GET /api/fires
- CORS so the frontend on :8765 can call the backend on :3001
- 03-my-watchers.html wired to the backend: live "Fire demo" button, real fire list, wallet balance stat
- tip cap dropped to $0.03 USDC for cheap repeated demo runs
Verified end-to-end: incident created → PR detected (react/react#36134, @gaearon) →
Claude decided tip → on-chain tx 0x234771b5...3e26 on Base mainnet → note posted in PD.
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Jul 31, 2026
…#1740)
Next.js 16.3 changes `next/error`'s `ErrorInfo` shape twice over: `error`
becomes `unknown` and `unstable_retry` is renamed to `retry`. All 34
`error.tsx` / `global-error.tsx` files imported `ErrorInfo` directly, so the
bump would have had to touch every one of them in the same commit.
Route them through `src/shared/lib/errors/error-boundary-props.ts` instead.
`ErrorBoundaryProps` takes `error: unknown` with both retry props optional, so
either version's `ErrorInfo` is assignable to it and Next's generated route
type validation accepts the components on 16.2 and 16.3 alike. Upgrading then
edits one file: make `retry` required and drop the fallback.
Motivation: 16.3 carries the React fix for `useDeferredValue` getting stuck
(react/react#36134), which is what leaves admin save buttons disabled on
"保存中..." forever after a revalidating Server Action while the write itself
succeeds (vercel/next.js#86055). Measured here on /admin/settings/features:
Next 16.2.12 hangs 5/5, Next 16.3.0-preview.10 hangs 0/5.
This commit deliberately does not bump `next` — 16.3.0 stable is unreleased.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
…pending hang (#1786)
revalidate 付き Server Action の後にクライアントが RSC ペイロードを commit せず、
送信ボタンが pending のまま戻らない上流バグ(react/react#36134 /
vercel/next.js#86055)の修正を取り込む。React core メンテナが 2026-07-03 に
「react#36134 で修正、16.3.0 で出る」と述べて issue を close しており、
**16.2.x への backport は無い**(v16.2.12 が 16.2 系の最終リリース)。
## 本番の実害
admin がイベントを作成すると、実際は DB に作成できているのに「作成中...」の
スピナーが戻らない。二重送信や再読込を誘発する。revalidate + redirect する
admin mutation 全般が対象(スペース料金プラン更新でも同型を確認)。
## 実測
production build で `events-create-online.spec.ts` を 10 回試行:
| next | 失敗 | 所要時間 |
| ------------------ | ------ | --------------- |
| 16.2.12 | 2 / 10 | 2.8 〜 26.9 秒 |
| 16.3.0-preview.10 | 0 / 10 | 2.6 〜 4.8 秒 |
失敗時もサーバーは 303 を 127〜170ms で返し切っており、クライアントが適用しない
だけだった(POST 完了 → URL 反映は成功時 0.10〜0.26 秒 / 失敗時は 20 秒経っても
起きない二値)。
## 広域 E2E の対照実験(#1783 適用後)
| run | next | failed | flaky | passed |
| ----------- | ------------------ | ------ | ----- | ------ |
| 30686096541 | 16.2.12 | 1 | 1 | 325 |
| 30686085976 | 16.3.0-preview.10 | 1 | 1 | 325 |
形が同一で回帰は見られない。hard failure は両方とも既存の
`mypage-receipt-download`。flaky は互いに別 spec でどちらも初出のノイズ。
## コスト
**ソース変更ゼロ**。PR #1740 の `src/shared/lib/errors/error-boundary-props.ts`
seam が 16.3 の `ErrorInfo` 破壊的変更を吸収済み。バンドルは -532 kB(-16.7%)。
stable ではなく preview を採る判断: 16.3.0 stable が未リリースである一方、
本番の実害が継続しているため。本番デプロイは workflow_dispatch のみなので
merge しても自動では出ない。revert は package.json 1 行。
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
`package.json` pins `next` to `16.3.0-preview.10`, but the dependency pin table
listed only Bun / TypeScript / Zod / Lexical, so nothing in the repo said this is
a pre-release or that it is meant to be temporary.
PR #1786 documented the reasoning well — upstream React `useDeferredValue` stuck
bug (react/react#36134 / vercel/next.js#86055) leaving Server Action submit
buttons permanently pending in production, fixed only in 16.3.0 with no 16.2
backport — but a merged PR body is not somewhere anyone looks. Without a pointer
in the pin table, "switch back when 16.3.0 stable ships" has no owner.
Renovate may well raise the stable bump on its own; this is the note that
explains, at review time, why the exact pin was pre-release to begin with.
Test plan:
- bun scripts/prettier.ts --check CLAUDE.md: exit 0
- Documentation only; no code paths touched.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
justmadeid25 added a commit to justmadeid25/senecial that referenced this pull request Aug 6, 2026
Root cause: a confirmed upstream React/Next.js 16 bug
(vercel/next.js#86055, fixed by react/react#36134 in Next 16.3.0) leaves
useTransition's isPending permanently stuck whenever a Server Action
invoked inside startTransition also triggers a router revalidation
(revalidatePath and/or router.refresh). The follow-up RSC fetch is
silently reported net::ERR_ABORTED with no console error, so the client
never applies the update - confirmed via live browser console capture
showing the action resolving successfully while the DOM stayed frozen.
Upgraded next 16.2.12 -> 16.3.0 to pick up the fix, and removed the now-
redundant client-side router.refresh() in the upload form (revalidatePath
already refreshes the route from the action's own response).
This unblocked two previously-hidden, unrelated bugs that only had a
chance to run for the first time once the upload step stopped
cascading-failing every serial test after it:
- runExtractionWorker() (and any other test helper that shells out via
`dotenv -e .env.e2e`) never received the run-specific
tmp/e2e-storage/prod-{runId} directory the spawned server actually
wrote uploads to, only .env.e2e's static default - same bug class as
the already-fixed TEST_MAILBOX_DIR. Fixed by threading
LOCAL_STORAGE_PATH into the Playwright process env in run-e2e-prod.ts.
- A strict-mode Playwright locator matched two stacked toast
notifications in extraction-flow.spec.ts; fixed with .last().
Verified: extraction-flow.spec.ts, ai-conversation-flow.spec.ts, and
clause-intelligence-flow.spec.ts (the three specs that failed 100%
reproducibly in the Phase 12.5 Linux CI comparison) all now pass cleanly
without any per-component changes beyond the framework upgrade. Full
local suite passed 101/101 twice consecutively.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
reiorozco added a commit to reiorozco/next-supabase-take-home that referenced this pull request Aug 14, 2026
La segunda navegación cliente consecutiva sobre /coffee-health actualizaba la
URL pero dejaba el contenido congelado en el estado anterior, y los enlaces de
los chips, calculados a partir de ese estado obsoleto, resucitaban filtros ya
eliminados. El fallo es una regresión upstream, no del código de esta feature:
se reproduce con AutoSubmit ausente del build, usando solo enlaces planos.
Su origen es un bug de React canary (react/react#35821, corregido por
react/react#36134 el 2026-03-24) que Next.js empaqueta internamente. El
arreglo llegó a la línea canary via vercel/next.js#91905 pero nunca se retroportó
a la rama estable 16.2: toda la línea 16.2.x, incluida la última versión 16.2.12,
sigue empaquetando React 19.3.0-canary-3f0b9e61-20260317, anterior al arreglo.
16.3.x empaqueta 19.3.0-canary-cbb046ab-20260731, posterior. Se reporta en
vercel/next.js#92152 y vercel/next.js#92787.
Fija la versión de forma exacta en lugar de dejar el tag flotante "latest", para
que el arreglo no se revierta de forma silenciosa en una instalación futura.
react y react-dom no cambian: los rangos de peer dependencies de 16.3.1 son
idénticos a los de 16.2.6.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: useDeferredValue gets stuck with a stale value

3 participants

@gaearon@react-sizebot@acdlite
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Fix useDeferredValue getting stuck by gaearon · Pull Request #36134 · react/react · GitHub
Skip to content

Fix useDeferredValue getting stuck - #36134

Merged
gaearon merged 3 commits into
mainfrom
fix-udv-stall
Mar 24, 2026
Merged

Fix useDeferredValue getting stuck#36134
gaearon merged 3 commits into
mainfrom
fix-udv-stall

Conversation

@gaearon

Copy link
Copy Markdown
Collaborator

Fixes#35821

Written/debugged by Claude.

Test Plan

@gaearon
gaearon requested a review from acdliteMarch 24, 2026 00:41
@github-actionsgithub-actionsBot added the React Core Team Opened by a member of the React Core Team label Mar 24, 2026
@react-sizebot

Copy link
Copy Markdown

Comparing: ed69815...df5ef86

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js+0.01%612.81 kB612.88 kB=108.29 kB108.30 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=678.75 kB678.81 kB=119.25 kB119.26 kB
facebook-www/ReactDOM-prod.classic.js=698.14 kB698.20 kB=122.65 kB122.65 kB
facebook-www/ReactDOM-prod.modern.js=688.45 kB688.52 kB=121.02 kB121.03 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against df5ef86

@acdliteacdlite left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Is it a good or a bad thing that there was already a TODO that (sorta) described the issue 😆

Discussed out-of-band, writing here for posterity:

The TODO I think is still correct, we should generalize that special-error-to-unwind-the-stack trick thing that we use for selective hydration. The main benefit is that if you're mid render it can restart immediately instead of burning cycles on a work-in-progress render that will inevitably get thrown out regardless. Leaving for a future PR in case we were to accidentally introduce a new bug in the progress.

@gaearon
gaearon merged commit c0d218f into mainMar 24, 2026
245 checks passed
@gaearon
gaearon deleted the fix-udv-stall branch March 24, 2026 00:49
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
dhernz added a commit to dhernz/watcher-protocol that referenced this pull request May 1, 2026
- server.ts: viem-based USDC tipping on Base mainnet from EconomyOS-provisioned wallet
- Claude reasoning step: agent decides tip amount or skip with one-line rationale
- PagerDuty REST integration: fetch incidents, find linked PR, post note with tx hash
- GitHub REST: PR author lookup
- new endpoints: POST /demo/run · GET /api/agent · GET /api/fires
- CORS so the frontend on :8765 can call the backend on :3001
- 03-my-watchers.html wired to the backend: live "Fire demo" button, real fire list, wallet balance stat
- tip cap dropped to $0.03 USDC for cheap repeated demo runs
Verified end-to-end: incident created → PR detected (react/react#36134, @gaearon) →
Claude decided tip → on-chain tx 0x234771b5...3e26 on Base mainnet → note posted in PD.
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Jul 31, 2026
…#1740)
Next.js 16.3 changes `next/error`'s `ErrorInfo` shape twice over: `error`
becomes `unknown` and `unstable_retry` is renamed to `retry`. All 34
`error.tsx` / `global-error.tsx` files imported `ErrorInfo` directly, so the
bump would have had to touch every one of them in the same commit.
Route them through `src/shared/lib/errors/error-boundary-props.ts` instead.
`ErrorBoundaryProps` takes `error: unknown` with both retry props optional, so
either version's `ErrorInfo` is assignable to it and Next's generated route
type validation accepts the components on 16.2 and 16.3 alike. Upgrading then
edits one file: make `retry` required and drop the fallback.
Motivation: 16.3 carries the React fix for `useDeferredValue` getting stuck
(react/react#36134), which is what leaves admin save buttons disabled on
"保存中..." forever after a revalidating Server Action while the write itself
succeeds (vercel/next.js#86055). Measured here on /admin/settings/features:
Next 16.2.12 hangs 5/5, Next 16.3.0-preview.10 hangs 0/5.
This commit deliberately does not bump `next` — 16.3.0 stable is unreleased.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
…pending hang (#1786)
revalidate 付き Server Action の後にクライアントが RSC ペイロードを commit せず、
送信ボタンが pending のまま戻らない上流バグ(react/react#36134 /
vercel/next.js#86055)の修正を取り込む。React core メンテナが 2026-07-03 に
「react#36134 で修正、16.3.0 で出る」と述べて issue を close しており、
**16.2.x への backport は無い**(v16.2.12 が 16.2 系の最終リリース)。
## 本番の実害
admin がイベントを作成すると、実際は DB に作成できているのに「作成中...」の
スピナーが戻らない。二重送信や再読込を誘発する。revalidate + redirect する
admin mutation 全般が対象(スペース料金プラン更新でも同型を確認)。
## 実測
production build で `events-create-online.spec.ts` を 10 回試行:
| next | 失敗 | 所要時間 |
| ------------------ | ------ | --------------- |
| 16.2.12 | 2 / 10 | 2.8 〜 26.9 秒 |
| 16.3.0-preview.10 | 0 / 10 | 2.6 〜 4.8 秒 |
失敗時もサーバーは 303 を 127〜170ms で返し切っており、クライアントが適用しない
だけだった(POST 完了 → URL 反映は成功時 0.10〜0.26 秒 / 失敗時は 20 秒経っても
起きない二値)。
## 広域 E2E の対照実験(#1783 適用後)
| run | next | failed | flaky | passed |
| ----------- | ------------------ | ------ | ----- | ------ |
| 30686096541 | 16.2.12 | 1 | 1 | 325 |
| 30686085976 | 16.3.0-preview.10 | 1 | 1 | 325 |
形が同一で回帰は見られない。hard failure は両方とも既存の
`mypage-receipt-download`。flaky は互いに別 spec でどちらも初出のノイズ。
## コスト
**ソース変更ゼロ**。PR #1740 の `src/shared/lib/errors/error-boundary-props.ts`
seam が 16.3 の `ErrorInfo` 破壊的変更を吸収済み。バンドルは -532 kB(-16.7%)。
stable ではなく preview を採る判断: 16.3.0 stable が未リリースである一方、
本番の実害が継続しているため。本番デプロイは workflow_dispatch のみなので
merge しても自動では出ない。revert は package.json 1 行。
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
`package.json` pins `next` to `16.3.0-preview.10`, but the dependency pin table
listed only Bun / TypeScript / Zod / Lexical, so nothing in the repo said this is
a pre-release or that it is meant to be temporary.
PR #1786 documented the reasoning well — upstream React `useDeferredValue` stuck
bug (react/react#36134 / vercel/next.js#86055) leaving Server Action submit
buttons permanently pending in production, fixed only in 16.3.0 with no 16.2
backport — but a merged PR body is not somewhere anyone looks. Without a pointer
in the pin table, "switch back when 16.3.0 stable ships" has no owner.
Renovate may well raise the stable bump on its own; this is the note that
explains, at review time, why the exact pin was pre-release to begin with.
Test plan:
- bun scripts/prettier.ts --check CLAUDE.md: exit 0
- Documentation only; no code paths touched.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
justmadeid25 added a commit to justmadeid25/senecial that referenced this pull request Aug 6, 2026
Root cause: a confirmed upstream React/Next.js 16 bug
(vercel/next.js#86055, fixed by react/react#36134 in Next 16.3.0) leaves
useTransition's isPending permanently stuck whenever a Server Action
invoked inside startTransition also triggers a router revalidation
(revalidatePath and/or router.refresh). The follow-up RSC fetch is
silently reported net::ERR_ABORTED with no console error, so the client
never applies the update - confirmed via live browser console capture
showing the action resolving successfully while the DOM stayed frozen.
Upgraded next 16.2.12 -> 16.3.0 to pick up the fix, and removed the now-
redundant client-side router.refresh() in the upload form (revalidatePath
already refreshes the route from the action's own response).
This unblocked two previously-hidden, unrelated bugs that only had a
chance to run for the first time once the upload step stopped
cascading-failing every serial test after it:
- runExtractionWorker() (and any other test helper that shells out via
`dotenv -e .env.e2e`) never received the run-specific
tmp/e2e-storage/prod-{runId} directory the spawned server actually
wrote uploads to, only .env.e2e's static default - same bug class as
the already-fixed TEST_MAILBOX_DIR. Fixed by threading
LOCAL_STORAGE_PATH into the Playwright process env in run-e2e-prod.ts.
- A strict-mode Playwright locator matched two stacked toast
notifications in extraction-flow.spec.ts; fixed with .last().
Verified: extraction-flow.spec.ts, ai-conversation-flow.spec.ts, and
clause-intelligence-flow.spec.ts (the three specs that failed 100%
reproducibly in the Phase 12.5 Linux CI comparison) all now pass cleanly
without any per-component changes beyond the framework upgrade. Full
local suite passed 101/101 twice consecutively.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
reiorozco added a commit to reiorozco/next-supabase-take-home that referenced this pull request Aug 14, 2026
La segunda navegación cliente consecutiva sobre /coffee-health actualizaba la
URL pero dejaba el contenido congelado en el estado anterior, y los enlaces de
los chips, calculados a partir de ese estado obsoleto, resucitaban filtros ya
eliminados. El fallo es una regresión upstream, no del código de esta feature:
se reproduce con AutoSubmit ausente del build, usando solo enlaces planos.
Su origen es un bug de React canary (react/react#35821, corregido por
react/react#36134 el 2026-03-24) que Next.js empaqueta internamente. El
arreglo llegó a la línea canary via vercel/next.js#91905 pero nunca se retroportó
a la rama estable 16.2: toda la línea 16.2.x, incluida la última versión 16.2.12,
sigue empaquetando React 19.3.0-canary-3f0b9e61-20260317, anterior al arreglo.
16.3.x empaqueta 19.3.0-canary-cbb046ab-20260731, posterior. Se reporta en
vercel/next.js#92152 y vercel/next.js#92787.
Fija la versión de forma exacta en lugar de dejar el tag flotante "latest", para
que el arreglo no se revierta de forma silenciosa en una instalación futura.
react y react-dom no cambian: los rangos de peer dependencies de 16.3.1 son
idénticos a los de 16.2.6.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: useDeferredValue gets stuck with a stale value

3 participants

@gaearon@react-sizebot@acdlite
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix useDeferredValue getting stuck by gaearon · Pull Request #36134 · react/react · GitHub
Skip to content

Fix useDeferredValue getting stuck - #36134

Merged
gaearon merged 3 commits into
mainfrom
fix-udv-stall
Mar 24, 2026
Merged

Fix useDeferredValue getting stuck#36134
gaearon merged 3 commits into
mainfrom
fix-udv-stall

Conversation

@gaearon

Copy link
Copy Markdown
Collaborator

Fixes#35821

Written/debugged by Claude.

Test Plan

@gaearon
gaearon requested a review from acdliteMarch 24, 2026 00:41
@github-actionsgithub-actionsBot added the React Core Team Opened by a member of the React Core Team label Mar 24, 2026
@react-sizebot

Copy link
Copy Markdown

Comparing: ed69815...df5ef86

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js+0.01%612.81 kB612.88 kB=108.29 kB108.30 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=678.75 kB678.81 kB=119.25 kB119.26 kB
facebook-www/ReactDOM-prod.classic.js=698.14 kB698.20 kB=122.65 kB122.65 kB
facebook-www/ReactDOM-prod.modern.js=688.45 kB688.52 kB=121.02 kB121.03 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against df5ef86

@acdliteacdlite left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Is it a good or a bad thing that there was already a TODO that (sorta) described the issue 😆

Discussed out-of-band, writing here for posterity:

The TODO I think is still correct, we should generalize that special-error-to-unwind-the-stack trick thing that we use for selective hydration. The main benefit is that if you're mid render it can restart immediately instead of burning cycles on a work-in-progress render that will inevitably get thrown out regardless. Leaving for a future PR in case we were to accidentally introduce a new bug in the progress.

@gaearon
gaearon merged commit c0d218f into mainMar 24, 2026
245 checks passed
@gaearon
gaearon deleted the fix-udv-stall branch March 24, 2026 00:49
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
dhernz added a commit to dhernz/watcher-protocol that referenced this pull request May 1, 2026
- server.ts: viem-based USDC tipping on Base mainnet from EconomyOS-provisioned wallet
- Claude reasoning step: agent decides tip amount or skip with one-line rationale
- PagerDuty REST integration: fetch incidents, find linked PR, post note with tx hash
- GitHub REST: PR author lookup
- new endpoints: POST /demo/run · GET /api/agent · GET /api/fires
- CORS so the frontend on :8765 can call the backend on :3001
- 03-my-watchers.html wired to the backend: live "Fire demo" button, real fire list, wallet balance stat
- tip cap dropped to $0.03 USDC for cheap repeated demo runs
Verified end-to-end: incident created → PR detected (react/react#36134, @gaearon) →
Claude decided tip → on-chain tx 0x234771b5...3e26 on Base mainnet → note posted in PD.
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Jul 31, 2026
…#1740)
Next.js 16.3 changes `next/error`'s `ErrorInfo` shape twice over: `error`
becomes `unknown` and `unstable_retry` is renamed to `retry`. All 34
`error.tsx` / `global-error.tsx` files imported `ErrorInfo` directly, so the
bump would have had to touch every one of them in the same commit.
Route them through `src/shared/lib/errors/error-boundary-props.ts` instead.
`ErrorBoundaryProps` takes `error: unknown` with both retry props optional, so
either version's `ErrorInfo` is assignable to it and Next's generated route
type validation accepts the components on 16.2 and 16.3 alike. Upgrading then
edits one file: make `retry` required and drop the fallback.
Motivation: 16.3 carries the React fix for `useDeferredValue` getting stuck
(react/react#36134), which is what leaves admin save buttons disabled on
"保存中..." forever after a revalidating Server Action while the write itself
succeeds (vercel/next.js#86055). Measured here on /admin/settings/features:
Next 16.2.12 hangs 5/5, Next 16.3.0-preview.10 hangs 0/5.
This commit deliberately does not bump `next` — 16.3.0 stable is unreleased.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
…pending hang (#1786)
revalidate 付き Server Action の後にクライアントが RSC ペイロードを commit せず、
送信ボタンが pending のまま戻らない上流バグ(react/react#36134 /
vercel/next.js#86055)の修正を取り込む。React core メンテナが 2026-07-03 に
「react#36134 で修正、16.3.0 で出る」と述べて issue を close しており、
**16.2.x への backport は無い**(v16.2.12 が 16.2 系の最終リリース)。
## 本番の実害
admin がイベントを作成すると、実際は DB に作成できているのに「作成中...」の
スピナーが戻らない。二重送信や再読込を誘発する。revalidate + redirect する
admin mutation 全般が対象(スペース料金プラン更新でも同型を確認)。
## 実測
production build で `events-create-online.spec.ts` を 10 回試行:
| next | 失敗 | 所要時間 |
| ------------------ | ------ | --------------- |
| 16.2.12 | 2 / 10 | 2.8 〜 26.9 秒 |
| 16.3.0-preview.10 | 0 / 10 | 2.6 〜 4.8 秒 |
失敗時もサーバーは 303 を 127〜170ms で返し切っており、クライアントが適用しない
だけだった(POST 完了 → URL 反映は成功時 0.10〜0.26 秒 / 失敗時は 20 秒経っても
起きない二値)。
## 広域 E2E の対照実験(#1783 適用後)
| run | next | failed | flaky | passed |
| ----------- | ------------------ | ------ | ----- | ------ |
| 30686096541 | 16.2.12 | 1 | 1 | 325 |
| 30686085976 | 16.3.0-preview.10 | 1 | 1 | 325 |
形が同一で回帰は見られない。hard failure は両方とも既存の
`mypage-receipt-download`。flaky は互いに別 spec でどちらも初出のノイズ。
## コスト
**ソース変更ゼロ**。PR #1740 の `src/shared/lib/errors/error-boundary-props.ts`
seam が 16.3 の `ErrorInfo` 破壊的変更を吸収済み。バンドルは -532 kB(-16.7%)。
stable ではなく preview を採る判断: 16.3.0 stable が未リリースである一方、
本番の実害が継続しているため。本番デプロイは workflow_dispatch のみなので
merge しても自動では出ない。revert は package.json 1 行。
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
`package.json` pins `next` to `16.3.0-preview.10`, but the dependency pin table
listed only Bun / TypeScript / Zod / Lexical, so nothing in the repo said this is
a pre-release or that it is meant to be temporary.
PR #1786 documented the reasoning well — upstream React `useDeferredValue` stuck
bug (react/react#36134 / vercel/next.js#86055) leaving Server Action submit
buttons permanently pending in production, fixed only in 16.3.0 with no 16.2
backport — but a merged PR body is not somewhere anyone looks. Without a pointer
in the pin table, "switch back when 16.3.0 stable ships" has no owner.
Renovate may well raise the stable bump on its own; this is the note that
explains, at review time, why the exact pin was pre-release to begin with.
Test plan:
- bun scripts/prettier.ts --check CLAUDE.md: exit 0
- Documentation only; no code paths touched.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
justmadeid25 added a commit to justmadeid25/senecial that referenced this pull request Aug 6, 2026
Root cause: a confirmed upstream React/Next.js 16 bug
(vercel/next.js#86055, fixed by react/react#36134 in Next 16.3.0) leaves
useTransition's isPending permanently stuck whenever a Server Action
invoked inside startTransition also triggers a router revalidation
(revalidatePath and/or router.refresh). The follow-up RSC fetch is
silently reported net::ERR_ABORTED with no console error, so the client
never applies the update - confirmed via live browser console capture
showing the action resolving successfully while the DOM stayed frozen.
Upgraded next 16.2.12 -> 16.3.0 to pick up the fix, and removed the now-
redundant client-side router.refresh() in the upload form (revalidatePath
already refreshes the route from the action's own response).
This unblocked two previously-hidden, unrelated bugs that only had a
chance to run for the first time once the upload step stopped
cascading-failing every serial test after it:
- runExtractionWorker() (and any other test helper that shells out via
`dotenv -e .env.e2e`) never received the run-specific
tmp/e2e-storage/prod-{runId} directory the spawned server actually
wrote uploads to, only .env.e2e's static default - same bug class as
the already-fixed TEST_MAILBOX_DIR. Fixed by threading
LOCAL_STORAGE_PATH into the Playwright process env in run-e2e-prod.ts.
- A strict-mode Playwright locator matched two stacked toast
notifications in extraction-flow.spec.ts; fixed with .last().
Verified: extraction-flow.spec.ts, ai-conversation-flow.spec.ts, and
clause-intelligence-flow.spec.ts (the three specs that failed 100%
reproducibly in the Phase 12.5 Linux CI comparison) all now pass cleanly
without any per-component changes beyond the framework upgrade. Full
local suite passed 101/101 twice consecutively.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
reiorozco added a commit to reiorozco/next-supabase-take-home that referenced this pull request Aug 14, 2026
La segunda navegación cliente consecutiva sobre /coffee-health actualizaba la
URL pero dejaba el contenido congelado en el estado anterior, y los enlaces de
los chips, calculados a partir de ese estado obsoleto, resucitaban filtros ya
eliminados. El fallo es una regresión upstream, no del código de esta feature:
se reproduce con AutoSubmit ausente del build, usando solo enlaces planos.
Su origen es un bug de React canary (react/react#35821, corregido por
react/react#36134 el 2026-03-24) que Next.js empaqueta internamente. El
arreglo llegó a la línea canary via vercel/next.js#91905 pero nunca se retroportó
a la rama estable 16.2: toda la línea 16.2.x, incluida la última versión 16.2.12,
sigue empaquetando React 19.3.0-canary-3f0b9e61-20260317, anterior al arreglo.
16.3.x empaqueta 19.3.0-canary-cbb046ab-20260731, posterior. Se reporta en
vercel/next.js#92152 y vercel/next.js#92787.
Fija la versión de forma exacta en lugar de dejar el tag flotante "latest", para
que el arreglo no se revierta de forma silenciosa en una instalación futura.
react y react-dom no cambian: los rangos de peer dependencies de 16.3.1 son
idénticos a los de 16.2.6.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: useDeferredValue gets stuck with a stale value

3 participants

@gaearon@react-sizebot@acdlite
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix useDeferredValue getting stuck by gaearon · Pull Request #36134 · react/react · GitHub
Skip to content

Fix useDeferredValue getting stuck - #36134

Merged
gaearon merged 3 commits into
mainfrom
fix-udv-stall
Mar 24, 2026
Merged

Fix useDeferredValue getting stuck#36134
gaearon merged 3 commits into
mainfrom
fix-udv-stall

Conversation

@gaearon

Copy link
Copy Markdown
Collaborator

Fixes#35821

Written/debugged by Claude.

Test Plan

@gaearon
gaearon requested a review from acdliteMarch 24, 2026 00:41
@github-actionsgithub-actionsBot added the React Core Team Opened by a member of the React Core Team label Mar 24, 2026
@react-sizebot

Copy link
Copy Markdown

Comparing: ed69815...df5ef86

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js+0.01%612.81 kB612.88 kB=108.29 kB108.30 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=678.75 kB678.81 kB=119.25 kB119.26 kB
facebook-www/ReactDOM-prod.classic.js=698.14 kB698.20 kB=122.65 kB122.65 kB
facebook-www/ReactDOM-prod.modern.js=688.45 kB688.52 kB=121.02 kB121.03 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against df5ef86

@acdliteacdlite left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Is it a good or a bad thing that there was already a TODO that (sorta) described the issue 😆

Discussed out-of-band, writing here for posterity:

The TODO I think is still correct, we should generalize that special-error-to-unwind-the-stack trick thing that we use for selective hydration. The main benefit is that if you're mid render it can restart immediately instead of burning cycles on a work-in-progress render that will inevitably get thrown out regardless. Leaving for a future PR in case we were to accidentally introduce a new bug in the progress.

@gaearon
gaearon merged commit c0d218f into mainMar 24, 2026
245 checks passed
@gaearon
gaearon deleted the fix-udv-stall branch March 24, 2026 00:49
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
dhernz added a commit to dhernz/watcher-protocol that referenced this pull request May 1, 2026
- server.ts: viem-based USDC tipping on Base mainnet from EconomyOS-provisioned wallet
- Claude reasoning step: agent decides tip amount or skip with one-line rationale
- PagerDuty REST integration: fetch incidents, find linked PR, post note with tx hash
- GitHub REST: PR author lookup
- new endpoints: POST /demo/run · GET /api/agent · GET /api/fires
- CORS so the frontend on :8765 can call the backend on :3001
- 03-my-watchers.html wired to the backend: live "Fire demo" button, real fire list, wallet balance stat
- tip cap dropped to $0.03 USDC for cheap repeated demo runs
Verified end-to-end: incident created → PR detected (react/react#36134, @gaearon) →
Claude decided tip → on-chain tx 0x234771b5...3e26 on Base mainnet → note posted in PD.
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Jul 31, 2026
…#1740)
Next.js 16.3 changes `next/error`'s `ErrorInfo` shape twice over: `error`
becomes `unknown` and `unstable_retry` is renamed to `retry`. All 34
`error.tsx` / `global-error.tsx` files imported `ErrorInfo` directly, so the
bump would have had to touch every one of them in the same commit.
Route them through `src/shared/lib/errors/error-boundary-props.ts` instead.
`ErrorBoundaryProps` takes `error: unknown` with both retry props optional, so
either version's `ErrorInfo` is assignable to it and Next's generated route
type validation accepts the components on 16.2 and 16.3 alike. Upgrading then
edits one file: make `retry` required and drop the fallback.
Motivation: 16.3 carries the React fix for `useDeferredValue` getting stuck
(react/react#36134), which is what leaves admin save buttons disabled on
"保存中..." forever after a revalidating Server Action while the write itself
succeeds (vercel/next.js#86055). Measured here on /admin/settings/features:
Next 16.2.12 hangs 5/5, Next 16.3.0-preview.10 hangs 0/5.
This commit deliberately does not bump `next` — 16.3.0 stable is unreleased.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
…pending hang (#1786)
revalidate 付き Server Action の後にクライアントが RSC ペイロードを commit せず、
送信ボタンが pending のまま戻らない上流バグ(react/react#36134 /
vercel/next.js#86055)の修正を取り込む。React core メンテナが 2026-07-03 に
「react#36134 で修正、16.3.0 で出る」と述べて issue を close しており、
**16.2.x への backport は無い**(v16.2.12 が 16.2 系の最終リリース)。
## 本番の実害
admin がイベントを作成すると、実際は DB に作成できているのに「作成中...」の
スピナーが戻らない。二重送信や再読込を誘発する。revalidate + redirect する
admin mutation 全般が対象(スペース料金プラン更新でも同型を確認)。
## 実測
production build で `events-create-online.spec.ts` を 10 回試行:
| next | 失敗 | 所要時間 |
| ------------------ | ------ | --------------- |
| 16.2.12 | 2 / 10 | 2.8 〜 26.9 秒 |
| 16.3.0-preview.10 | 0 / 10 | 2.6 〜 4.8 秒 |
失敗時もサーバーは 303 を 127〜170ms で返し切っており、クライアントが適用しない
だけだった(POST 完了 → URL 反映は成功時 0.10〜0.26 秒 / 失敗時は 20 秒経っても
起きない二値)。
## 広域 E2E の対照実験(#1783 適用後)
| run | next | failed | flaky | passed |
| ----------- | ------------------ | ------ | ----- | ------ |
| 30686096541 | 16.2.12 | 1 | 1 | 325 |
| 30686085976 | 16.3.0-preview.10 | 1 | 1 | 325 |
形が同一で回帰は見られない。hard failure は両方とも既存の
`mypage-receipt-download`。flaky は互いに別 spec でどちらも初出のノイズ。
## コスト
**ソース変更ゼロ**。PR #1740 の `src/shared/lib/errors/error-boundary-props.ts`
seam が 16.3 の `ErrorInfo` 破壊的変更を吸収済み。バンドルは -532 kB(-16.7%)。
stable ではなく preview を採る判断: 16.3.0 stable が未リリースである一方、
本番の実害が継続しているため。本番デプロイは workflow_dispatch のみなので
merge しても自動では出ない。revert は package.json 1 行。
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
`package.json` pins `next` to `16.3.0-preview.10`, but the dependency pin table
listed only Bun / TypeScript / Zod / Lexical, so nothing in the repo said this is
a pre-release or that it is meant to be temporary.
PR #1786 documented the reasoning well — upstream React `useDeferredValue` stuck
bug (react/react#36134 / vercel/next.js#86055) leaving Server Action submit
buttons permanently pending in production, fixed only in 16.3.0 with no 16.2
backport — but a merged PR body is not somewhere anyone looks. Without a pointer
in the pin table, "switch back when 16.3.0 stable ships" has no owner.
Renovate may well raise the stable bump on its own; this is the note that
explains, at review time, why the exact pin was pre-release to begin with.
Test plan:
- bun scripts/prettier.ts --check CLAUDE.md: exit 0
- Documentation only; no code paths touched.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
justmadeid25 added a commit to justmadeid25/senecial that referenced this pull request Aug 6, 2026
Root cause: a confirmed upstream React/Next.js 16 bug
(vercel/next.js#86055, fixed by react/react#36134 in Next 16.3.0) leaves
useTransition's isPending permanently stuck whenever a Server Action
invoked inside startTransition also triggers a router revalidation
(revalidatePath and/or router.refresh). The follow-up RSC fetch is
silently reported net::ERR_ABORTED with no console error, so the client
never applies the update - confirmed via live browser console capture
showing the action resolving successfully while the DOM stayed frozen.
Upgraded next 16.2.12 -> 16.3.0 to pick up the fix, and removed the now-
redundant client-side router.refresh() in the upload form (revalidatePath
already refreshes the route from the action's own response).
This unblocked two previously-hidden, unrelated bugs that only had a
chance to run for the first time once the upload step stopped
cascading-failing every serial test after it:
- runExtractionWorker() (and any other test helper that shells out via
`dotenv -e .env.e2e`) never received the run-specific
tmp/e2e-storage/prod-{runId} directory the spawned server actually
wrote uploads to, only .env.e2e's static default - same bug class as
the already-fixed TEST_MAILBOX_DIR. Fixed by threading
LOCAL_STORAGE_PATH into the Playwright process env in run-e2e-prod.ts.
- A strict-mode Playwright locator matched two stacked toast
notifications in extraction-flow.spec.ts; fixed with .last().
Verified: extraction-flow.spec.ts, ai-conversation-flow.spec.ts, and
clause-intelligence-flow.spec.ts (the three specs that failed 100%
reproducibly in the Phase 12.5 Linux CI comparison) all now pass cleanly
without any per-component changes beyond the framework upgrade. Full
local suite passed 101/101 twice consecutively.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
reiorozco added a commit to reiorozco/next-supabase-take-home that referenced this pull request Aug 14, 2026
La segunda navegación cliente consecutiva sobre /coffee-health actualizaba la
URL pero dejaba el contenido congelado en el estado anterior, y los enlaces de
los chips, calculados a partir de ese estado obsoleto, resucitaban filtros ya
eliminados. El fallo es una regresión upstream, no del código de esta feature:
se reproduce con AutoSubmit ausente del build, usando solo enlaces planos.
Su origen es un bug de React canary (react/react#35821, corregido por
react/react#36134 el 2026-03-24) que Next.js empaqueta internamente. El
arreglo llegó a la línea canary via vercel/next.js#91905 pero nunca se retroportó
a la rama estable 16.2: toda la línea 16.2.x, incluida la última versión 16.2.12,
sigue empaquetando React 19.3.0-canary-3f0b9e61-20260317, anterior al arreglo.
16.3.x empaqueta 19.3.0-canary-cbb046ab-20260731, posterior. Se reporta en
vercel/next.js#92152 y vercel/next.js#92787.
Fija la versión de forma exacta en lugar de dejar el tag flotante "latest", para
que el arreglo no se revierta de forma silenciosa en una instalación futura.
react y react-dom no cambian: los rangos de peer dependencies de 16.3.1 son
idénticos a los de 16.2.6.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: useDeferredValue gets stuck with a stale value

3 participants

@gaearon@react-sizebot@acdlite
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Fix useDeferredValue getting stuck by gaearon · Pull Request #36134 · react/react · GitHub
Skip to content

Fix useDeferredValue getting stuck - #36134

Merged
gaearon merged 3 commits into
mainfrom
fix-udv-stall
Mar 24, 2026
Merged

Fix useDeferredValue getting stuck#36134
gaearon merged 3 commits into
mainfrom
fix-udv-stall

Conversation

@gaearon

Copy link
Copy Markdown
Collaborator

Fixes#35821

Written/debugged by Claude.

Test Plan

@gaearon
gaearon requested a review from acdliteMarch 24, 2026 00:41
@github-actionsgithub-actionsBot added the React Core Team Opened by a member of the React Core Team label Mar 24, 2026
@react-sizebot

Copy link
Copy Markdown

Comparing: ed69815...df5ef86

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js+0.01%612.81 kB612.88 kB=108.29 kB108.30 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=678.75 kB678.81 kB=119.25 kB119.26 kB
facebook-www/ReactDOM-prod.classic.js=698.14 kB698.20 kB=122.65 kB122.65 kB
facebook-www/ReactDOM-prod.modern.js=688.45 kB688.52 kB=121.02 kB121.03 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against df5ef86

@acdliteacdlite left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Is it a good or a bad thing that there was already a TODO that (sorta) described the issue 😆

Discussed out-of-band, writing here for posterity:

The TODO I think is still correct, we should generalize that special-error-to-unwind-the-stack trick thing that we use for selective hydration. The main benefit is that if you're mid render it can restart immediately instead of burning cycles on a work-in-progress render that will inevitably get thrown out regardless. Leaving for a future PR in case we were to accidentally introduce a new bug in the progress.

@gaearon
gaearon merged commit c0d218f into mainMar 24, 2026
245 checks passed
@gaearon
gaearon deleted the fix-udv-stall branch March 24, 2026 00:49
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
dhernz added a commit to dhernz/watcher-protocol that referenced this pull request May 1, 2026
- server.ts: viem-based USDC tipping on Base mainnet from EconomyOS-provisioned wallet
- Claude reasoning step: agent decides tip amount or skip with one-line rationale
- PagerDuty REST integration: fetch incidents, find linked PR, post note with tx hash
- GitHub REST: PR author lookup
- new endpoints: POST /demo/run · GET /api/agent · GET /api/fires
- CORS so the frontend on :8765 can call the backend on :3001
- 03-my-watchers.html wired to the backend: live "Fire demo" button, real fire list, wallet balance stat
- tip cap dropped to $0.03 USDC for cheap repeated demo runs
Verified end-to-end: incident created → PR detected (react/react#36134, @gaearon) →
Claude decided tip → on-chain tx 0x234771b5...3e26 on Base mainnet → note posted in PD.
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Jul 31, 2026
…#1740)
Next.js 16.3 changes `next/error`'s `ErrorInfo` shape twice over: `error`
becomes `unknown` and `unstable_retry` is renamed to `retry`. All 34
`error.tsx` / `global-error.tsx` files imported `ErrorInfo` directly, so the
bump would have had to touch every one of them in the same commit.
Route them through `src/shared/lib/errors/error-boundary-props.ts` instead.
`ErrorBoundaryProps` takes `error: unknown` with both retry props optional, so
either version's `ErrorInfo` is assignable to it and Next's generated route
type validation accepts the components on 16.2 and 16.3 alike. Upgrading then
edits one file: make `retry` required and drop the fallback.
Motivation: 16.3 carries the React fix for `useDeferredValue` getting stuck
(react/react#36134), which is what leaves admin save buttons disabled on
"保存中..." forever after a revalidating Server Action while the write itself
succeeds (vercel/next.js#86055). Measured here on /admin/settings/features:
Next 16.2.12 hangs 5/5, Next 16.3.0-preview.10 hangs 0/5.
This commit deliberately does not bump `next` — 16.3.0 stable is unreleased.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
…pending hang (#1786)
revalidate 付き Server Action の後にクライアントが RSC ペイロードを commit せず、
送信ボタンが pending のまま戻らない上流バグ(react/react#36134 /
vercel/next.js#86055)の修正を取り込む。React core メンテナが 2026-07-03 に
「react#36134 で修正、16.3.0 で出る」と述べて issue を close しており、
**16.2.x への backport は無い**(v16.2.12 が 16.2 系の最終リリース)。
## 本番の実害
admin がイベントを作成すると、実際は DB に作成できているのに「作成中...」の
スピナーが戻らない。二重送信や再読込を誘発する。revalidate + redirect する
admin mutation 全般が対象(スペース料金プラン更新でも同型を確認)。
## 実測
production build で `events-create-online.spec.ts` を 10 回試行:
| next | 失敗 | 所要時間 |
| ------------------ | ------ | --------------- |
| 16.2.12 | 2 / 10 | 2.8 〜 26.9 秒 |
| 16.3.0-preview.10 | 0 / 10 | 2.6 〜 4.8 秒 |
失敗時もサーバーは 303 を 127〜170ms で返し切っており、クライアントが適用しない
だけだった(POST 完了 → URL 反映は成功時 0.10〜0.26 秒 / 失敗時は 20 秒経っても
起きない二値)。
## 広域 E2E の対照実験(#1783 適用後)
| run | next | failed | flaky | passed |
| ----------- | ------------------ | ------ | ----- | ------ |
| 30686096541 | 16.2.12 | 1 | 1 | 325 |
| 30686085976 | 16.3.0-preview.10 | 1 | 1 | 325 |
形が同一で回帰は見られない。hard failure は両方とも既存の
`mypage-receipt-download`。flaky は互いに別 spec でどちらも初出のノイズ。
## コスト
**ソース変更ゼロ**。PR #1740 の `src/shared/lib/errors/error-boundary-props.ts`
seam が 16.3 の `ErrorInfo` 破壊的変更を吸収済み。バンドルは -532 kB(-16.7%)。
stable ではなく preview を採る判断: 16.3.0 stable が未リリースである一方、
本番の実害が継続しているため。本番デプロイは workflow_dispatch のみなので
merge しても自動では出ない。revert は package.json 1 行。
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
`package.json` pins `next` to `16.3.0-preview.10`, but the dependency pin table
listed only Bun / TypeScript / Zod / Lexical, so nothing in the repo said this is
a pre-release or that it is meant to be temporary.
PR #1786 documented the reasoning well — upstream React `useDeferredValue` stuck
bug (react/react#36134 / vercel/next.js#86055) leaving Server Action submit
buttons permanently pending in production, fixed only in 16.3.0 with no 16.2
backport — but a merged PR body is not somewhere anyone looks. Without a pointer
in the pin table, "switch back when 16.3.0 stable ships" has no owner.
Renovate may well raise the stable bump on its own; this is the note that
explains, at review time, why the exact pin was pre-release to begin with.
Test plan:
- bun scripts/prettier.ts --check CLAUDE.md: exit 0
- Documentation only; no code paths touched.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
justmadeid25 added a commit to justmadeid25/senecial that referenced this pull request Aug 6, 2026
Root cause: a confirmed upstream React/Next.js 16 bug
(vercel/next.js#86055, fixed by react/react#36134 in Next 16.3.0) leaves
useTransition's isPending permanently stuck whenever a Server Action
invoked inside startTransition also triggers a router revalidation
(revalidatePath and/or router.refresh). The follow-up RSC fetch is
silently reported net::ERR_ABORTED with no console error, so the client
never applies the update - confirmed via live browser console capture
showing the action resolving successfully while the DOM stayed frozen.
Upgraded next 16.2.12 -> 16.3.0 to pick up the fix, and removed the now-
redundant client-side router.refresh() in the upload form (revalidatePath
already refreshes the route from the action's own response).
This unblocked two previously-hidden, unrelated bugs that only had a
chance to run for the first time once the upload step stopped
cascading-failing every serial test after it:
- runExtractionWorker() (and any other test helper that shells out via
`dotenv -e .env.e2e`) never received the run-specific
tmp/e2e-storage/prod-{runId} directory the spawned server actually
wrote uploads to, only .env.e2e's static default - same bug class as
the already-fixed TEST_MAILBOX_DIR. Fixed by threading
LOCAL_STORAGE_PATH into the Playwright process env in run-e2e-prod.ts.
- A strict-mode Playwright locator matched two stacked toast
notifications in extraction-flow.spec.ts; fixed with .last().
Verified: extraction-flow.spec.ts, ai-conversation-flow.spec.ts, and
clause-intelligence-flow.spec.ts (the three specs that failed 100%
reproducibly in the Phase 12.5 Linux CI comparison) all now pass cleanly
without any per-component changes beyond the framework upgrade. Full
local suite passed 101/101 twice consecutively.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
reiorozco added a commit to reiorozco/next-supabase-take-home that referenced this pull request Aug 14, 2026
La segunda navegación cliente consecutiva sobre /coffee-health actualizaba la
URL pero dejaba el contenido congelado en el estado anterior, y los enlaces de
los chips, calculados a partir de ese estado obsoleto, resucitaban filtros ya
eliminados. El fallo es una regresión upstream, no del código de esta feature:
se reproduce con AutoSubmit ausente del build, usando solo enlaces planos.
Su origen es un bug de React canary (react/react#35821, corregido por
react/react#36134 el 2026-03-24) que Next.js empaqueta internamente. El
arreglo llegó a la línea canary via vercel/next.js#91905 pero nunca se retroportó
a la rama estable 16.2: toda la línea 16.2.x, incluida la última versión 16.2.12,
sigue empaquetando React 19.3.0-canary-3f0b9e61-20260317, anterior al arreglo.
16.3.x empaqueta 19.3.0-canary-cbb046ab-20260731, posterior. Se reporta en
vercel/next.js#92152 y vercel/next.js#92787.
Fija la versión de forma exacta en lugar de dejar el tag flotante "latest", para
que el arreglo no se revierta de forma silenciosa en una instalación futura.
react y react-dom no cambian: los rangos de peer dependencies de 16.3.1 son
idénticos a los de 16.2.6.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: useDeferredValue gets stuck with a stale value

3 participants

@gaearon@react-sizebot@acdlite
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix useDeferredValue getting stuck by gaearon · Pull Request #36134 · react/react · GitHub
Skip to content

Fix useDeferredValue getting stuck - #36134

Merged
gaearon merged 3 commits into
mainfrom
fix-udv-stall
Mar 24, 2026
Merged

Fix useDeferredValue getting stuck#36134
gaearon merged 3 commits into
mainfrom
fix-udv-stall

Conversation

@gaearon

Copy link
Copy Markdown
Collaborator

Fixes#35821

Written/debugged by Claude.

Test Plan

@gaearon
gaearon requested a review from acdliteMarch 24, 2026 00:41
@github-actionsgithub-actionsBot added the React Core Team Opened by a member of the React Core Team label Mar 24, 2026
@react-sizebot

Copy link
Copy Markdown

Comparing: ed69815...df5ef86

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js+0.01%612.81 kB612.88 kB=108.29 kB108.30 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=678.75 kB678.81 kB=119.25 kB119.26 kB
facebook-www/ReactDOM-prod.classic.js=698.14 kB698.20 kB=122.65 kB122.65 kB
facebook-www/ReactDOM-prod.modern.js=688.45 kB688.52 kB=121.02 kB121.03 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against df5ef86

@acdliteacdlite left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Is it a good or a bad thing that there was already a TODO that (sorta) described the issue 😆

Discussed out-of-band, writing here for posterity:

The TODO I think is still correct, we should generalize that special-error-to-unwind-the-stack trick thing that we use for selective hydration. The main benefit is that if you're mid render it can restart immediately instead of burning cycles on a work-in-progress render that will inevitably get thrown out regardless. Leaving for a future PR in case we were to accidentally introduce a new bug in the progress.

@gaearon
gaearon merged commit c0d218f into mainMar 24, 2026
245 checks passed
@gaearon
gaearon deleted the fix-udv-stall branch March 24, 2026 00:49
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
dhernz added a commit to dhernz/watcher-protocol that referenced this pull request May 1, 2026
- server.ts: viem-based USDC tipping on Base mainnet from EconomyOS-provisioned wallet
- Claude reasoning step: agent decides tip amount or skip with one-line rationale
- PagerDuty REST integration: fetch incidents, find linked PR, post note with tx hash
- GitHub REST: PR author lookup
- new endpoints: POST /demo/run · GET /api/agent · GET /api/fires
- CORS so the frontend on :8765 can call the backend on :3001
- 03-my-watchers.html wired to the backend: live "Fire demo" button, real fire list, wallet balance stat
- tip cap dropped to $0.03 USDC for cheap repeated demo runs
Verified end-to-end: incident created → PR detected (react/react#36134, @gaearon) →
Claude decided tip → on-chain tx 0x234771b5...3e26 on Base mainnet → note posted in PD.
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Jul 31, 2026
…#1740)
Next.js 16.3 changes `next/error`'s `ErrorInfo` shape twice over: `error`
becomes `unknown` and `unstable_retry` is renamed to `retry`. All 34
`error.tsx` / `global-error.tsx` files imported `ErrorInfo` directly, so the
bump would have had to touch every one of them in the same commit.
Route them through `src/shared/lib/errors/error-boundary-props.ts` instead.
`ErrorBoundaryProps` takes `error: unknown` with both retry props optional, so
either version's `ErrorInfo` is assignable to it and Next's generated route
type validation accepts the components on 16.2 and 16.3 alike. Upgrading then
edits one file: make `retry` required and drop the fallback.
Motivation: 16.3 carries the React fix for `useDeferredValue` getting stuck
(react/react#36134), which is what leaves admin save buttons disabled on
"保存中..." forever after a revalidating Server Action while the write itself
succeeds (vercel/next.js#86055). Measured here on /admin/settings/features:
Next 16.2.12 hangs 5/5, Next 16.3.0-preview.10 hangs 0/5.
This commit deliberately does not bump `next` — 16.3.0 stable is unreleased.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
…pending hang (#1786)
revalidate 付き Server Action の後にクライアントが RSC ペイロードを commit せず、
送信ボタンが pending のまま戻らない上流バグ(react/react#36134 /
vercel/next.js#86055)の修正を取り込む。React core メンテナが 2026-07-03 に
「react#36134 で修正、16.3.0 で出る」と述べて issue を close しており、
**16.2.x への backport は無い**(v16.2.12 が 16.2 系の最終リリース)。
## 本番の実害
admin がイベントを作成すると、実際は DB に作成できているのに「作成中...」の
スピナーが戻らない。二重送信や再読込を誘発する。revalidate + redirect する
admin mutation 全般が対象(スペース料金プラン更新でも同型を確認)。
## 実測
production build で `events-create-online.spec.ts` を 10 回試行:
| next | 失敗 | 所要時間 |
| ------------------ | ------ | --------------- |
| 16.2.12 | 2 / 10 | 2.8 〜 26.9 秒 |
| 16.3.0-preview.10 | 0 / 10 | 2.6 〜 4.8 秒 |
失敗時もサーバーは 303 を 127〜170ms で返し切っており、クライアントが適用しない
だけだった(POST 完了 → URL 反映は成功時 0.10〜0.26 秒 / 失敗時は 20 秒経っても
起きない二値)。
## 広域 E2E の対照実験(#1783 適用後)
| run | next | failed | flaky | passed |
| ----------- | ------------------ | ------ | ----- | ------ |
| 30686096541 | 16.2.12 | 1 | 1 | 325 |
| 30686085976 | 16.3.0-preview.10 | 1 | 1 | 325 |
形が同一で回帰は見られない。hard failure は両方とも既存の
`mypage-receipt-download`。flaky は互いに別 spec でどちらも初出のノイズ。
## コスト
**ソース変更ゼロ**。PR #1740 の `src/shared/lib/errors/error-boundary-props.ts`
seam が 16.3 の `ErrorInfo` 破壊的変更を吸収済み。バンドルは -532 kB(-16.7%)。
stable ではなく preview を採る判断: 16.3.0 stable が未リリースである一方、
本番の実害が継続しているため。本番デプロイは workflow_dispatch のみなので
merge しても自動では出ない。revert は package.json 1 行。
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
`package.json` pins `next` to `16.3.0-preview.10`, but the dependency pin table
listed only Bun / TypeScript / Zod / Lexical, so nothing in the repo said this is
a pre-release or that it is meant to be temporary.
PR #1786 documented the reasoning well — upstream React `useDeferredValue` stuck
bug (react/react#36134 / vercel/next.js#86055) leaving Server Action submit
buttons permanently pending in production, fixed only in 16.3.0 with no 16.2
backport — but a merged PR body is not somewhere anyone looks. Without a pointer
in the pin table, "switch back when 16.3.0 stable ships" has no owner.
Renovate may well raise the stable bump on its own; this is the note that
explains, at review time, why the exact pin was pre-release to begin with.
Test plan:
- bun scripts/prettier.ts --check CLAUDE.md: exit 0
- Documentation only; no code paths touched.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
justmadeid25 added a commit to justmadeid25/senecial that referenced this pull request Aug 6, 2026
Root cause: a confirmed upstream React/Next.js 16 bug
(vercel/next.js#86055, fixed by react/react#36134 in Next 16.3.0) leaves
useTransition's isPending permanently stuck whenever a Server Action
invoked inside startTransition also triggers a router revalidation
(revalidatePath and/or router.refresh). The follow-up RSC fetch is
silently reported net::ERR_ABORTED with no console error, so the client
never applies the update - confirmed via live browser console capture
showing the action resolving successfully while the DOM stayed frozen.
Upgraded next 16.2.12 -> 16.3.0 to pick up the fix, and removed the now-
redundant client-side router.refresh() in the upload form (revalidatePath
already refreshes the route from the action's own response).
This unblocked two previously-hidden, unrelated bugs that only had a
chance to run for the first time once the upload step stopped
cascading-failing every serial test after it:
- runExtractionWorker() (and any other test helper that shells out via
`dotenv -e .env.e2e`) never received the run-specific
tmp/e2e-storage/prod-{runId} directory the spawned server actually
wrote uploads to, only .env.e2e's static default - same bug class as
the already-fixed TEST_MAILBOX_DIR. Fixed by threading
LOCAL_STORAGE_PATH into the Playwright process env in run-e2e-prod.ts.
- A strict-mode Playwright locator matched two stacked toast
notifications in extraction-flow.spec.ts; fixed with .last().
Verified: extraction-flow.spec.ts, ai-conversation-flow.spec.ts, and
clause-intelligence-flow.spec.ts (the three specs that failed 100%
reproducibly in the Phase 12.5 Linux CI comparison) all now pass cleanly
without any per-component changes beyond the framework upgrade. Full
local suite passed 101/101 twice consecutively.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
reiorozco added a commit to reiorozco/next-supabase-take-home that referenced this pull request Aug 14, 2026
La segunda navegación cliente consecutiva sobre /coffee-health actualizaba la
URL pero dejaba el contenido congelado en el estado anterior, y los enlaces de
los chips, calculados a partir de ese estado obsoleto, resucitaban filtros ya
eliminados. El fallo es una regresión upstream, no del código de esta feature:
se reproduce con AutoSubmit ausente del build, usando solo enlaces planos.
Su origen es un bug de React canary (react/react#35821, corregido por
react/react#36134 el 2026-03-24) que Next.js empaqueta internamente. El
arreglo llegó a la línea canary via vercel/next.js#91905 pero nunca se retroportó
a la rama estable 16.2: toda la línea 16.2.x, incluida la última versión 16.2.12,
sigue empaquetando React 19.3.0-canary-3f0b9e61-20260317, anterior al arreglo.
16.3.x empaqueta 19.3.0-canary-cbb046ab-20260731, posterior. Se reporta en
vercel/next.js#92152 y vercel/next.js#92787.
Fija la versión de forma exacta en lugar de dejar el tag flotante "latest", para
que el arreglo no se revierta de forma silenciosa en una instalación futura.
react y react-dom no cambian: los rangos de peer dependencies de 16.3.1 son
idénticos a los de 16.2.6.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: useDeferredValue gets stuck with a stale value

3 participants

@gaearon@react-sizebot@acdlite
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Fix useDeferredValue getting stuck by gaearon · Pull Request #36134 · react/react · GitHub
Skip to content

Fix useDeferredValue getting stuck - #36134

Merged
gaearon merged 3 commits into
mainfrom
fix-udv-stall
Mar 24, 2026
Merged

Fix useDeferredValue getting stuck#36134
gaearon merged 3 commits into
mainfrom
fix-udv-stall

Conversation

@gaearon

Copy link
Copy Markdown
Collaborator

Fixes#35821

Written/debugged by Claude.

Test Plan

@gaearon
gaearon requested a review from acdliteMarch 24, 2026 00:41
@github-actionsgithub-actionsBot added the React Core Team Opened by a member of the React Core Team label Mar 24, 2026
@react-sizebot

Copy link
Copy Markdown

Comparing: ed69815...df5ef86

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js+0.01%612.81 kB612.88 kB=108.29 kB108.30 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=678.75 kB678.81 kB=119.25 kB119.26 kB
facebook-www/ReactDOM-prod.classic.js=698.14 kB698.20 kB=122.65 kB122.65 kB
facebook-www/ReactDOM-prod.modern.js=688.45 kB688.52 kB=121.02 kB121.03 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against df5ef86

@acdliteacdlite left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Is it a good or a bad thing that there was already a TODO that (sorta) described the issue 😆

Discussed out-of-band, writing here for posterity:

The TODO I think is still correct, we should generalize that special-error-to-unwind-the-stack trick thing that we use for selective hydration. The main benefit is that if you're mid render it can restart immediately instead of burning cycles on a work-in-progress render that will inevitably get thrown out regardless. Leaving for a future PR in case we were to accidentally introduce a new bug in the progress.

@gaearon
gaearon merged commit c0d218f into mainMar 24, 2026
245 checks passed
@gaearon
gaearon deleted the fix-udv-stall branch March 24, 2026 00:49
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
dhernz added a commit to dhernz/watcher-protocol that referenced this pull request May 1, 2026
- server.ts: viem-based USDC tipping on Base mainnet from EconomyOS-provisioned wallet
- Claude reasoning step: agent decides tip amount or skip with one-line rationale
- PagerDuty REST integration: fetch incidents, find linked PR, post note with tx hash
- GitHub REST: PR author lookup
- new endpoints: POST /demo/run · GET /api/agent · GET /api/fires
- CORS so the frontend on :8765 can call the backend on :3001
- 03-my-watchers.html wired to the backend: live "Fire demo" button, real fire list, wallet balance stat
- tip cap dropped to $0.03 USDC for cheap repeated demo runs
Verified end-to-end: incident created → PR detected (react/react#36134, @gaearon) →
Claude decided tip → on-chain tx 0x234771b5...3e26 on Base mainnet → note posted in PD.
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Jul 31, 2026
…#1740)
Next.js 16.3 changes `next/error`'s `ErrorInfo` shape twice over: `error`
becomes `unknown` and `unstable_retry` is renamed to `retry`. All 34
`error.tsx` / `global-error.tsx` files imported `ErrorInfo` directly, so the
bump would have had to touch every one of them in the same commit.
Route them through `src/shared/lib/errors/error-boundary-props.ts` instead.
`ErrorBoundaryProps` takes `error: unknown` with both retry props optional, so
either version's `ErrorInfo` is assignable to it and Next's generated route
type validation accepts the components on 16.2 and 16.3 alike. Upgrading then
edits one file: make `retry` required and drop the fallback.
Motivation: 16.3 carries the React fix for `useDeferredValue` getting stuck
(react/react#36134), which is what leaves admin save buttons disabled on
"保存中..." forever after a revalidating Server Action while the write itself
succeeds (vercel/next.js#86055). Measured here on /admin/settings/features:
Next 16.2.12 hangs 5/5, Next 16.3.0-preview.10 hangs 0/5.
This commit deliberately does not bump `next` — 16.3.0 stable is unreleased.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
…pending hang (#1786)
revalidate 付き Server Action の後にクライアントが RSC ペイロードを commit せず、
送信ボタンが pending のまま戻らない上流バグ(react/react#36134 /
vercel/next.js#86055)の修正を取り込む。React core メンテナが 2026-07-03 に
「react#36134 で修正、16.3.0 で出る」と述べて issue を close しており、
**16.2.x への backport は無い**(v16.2.12 が 16.2 系の最終リリース)。
## 本番の実害
admin がイベントを作成すると、実際は DB に作成できているのに「作成中...」の
スピナーが戻らない。二重送信や再読込を誘発する。revalidate + redirect する
admin mutation 全般が対象(スペース料金プラン更新でも同型を確認)。
## 実測
production build で `events-create-online.spec.ts` を 10 回試行:
| next | 失敗 | 所要時間 |
| ------------------ | ------ | --------------- |
| 16.2.12 | 2 / 10 | 2.8 〜 26.9 秒 |
| 16.3.0-preview.10 | 0 / 10 | 2.6 〜 4.8 秒 |
失敗時もサーバーは 303 を 127〜170ms で返し切っており、クライアントが適用しない
だけだった(POST 完了 → URL 反映は成功時 0.10〜0.26 秒 / 失敗時は 20 秒経っても
起きない二値)。
## 広域 E2E の対照実験(#1783 適用後)
| run | next | failed | flaky | passed |
| ----------- | ------------------ | ------ | ----- | ------ |
| 30686096541 | 16.2.12 | 1 | 1 | 325 |
| 30686085976 | 16.3.0-preview.10 | 1 | 1 | 325 |
形が同一で回帰は見られない。hard failure は両方とも既存の
`mypage-receipt-download`。flaky は互いに別 spec でどちらも初出のノイズ。
## コスト
**ソース変更ゼロ**。PR #1740 の `src/shared/lib/errors/error-boundary-props.ts`
seam が 16.3 の `ErrorInfo` 破壊的変更を吸収済み。バンドルは -532 kB(-16.7%)。
stable ではなく preview を採る判断: 16.3.0 stable が未リリースである一方、
本番の実害が継続しているため。本番デプロイは workflow_dispatch のみなので
merge しても自動では出ない。revert は package.json 1 行。
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
`package.json` pins `next` to `16.3.0-preview.10`, but the dependency pin table
listed only Bun / TypeScript / Zod / Lexical, so nothing in the repo said this is
a pre-release or that it is meant to be temporary.
PR #1786 documented the reasoning well — upstream React `useDeferredValue` stuck
bug (react/react#36134 / vercel/next.js#86055) leaving Server Action submit
buttons permanently pending in production, fixed only in 16.3.0 with no 16.2
backport — but a merged PR body is not somewhere anyone looks. Without a pointer
in the pin table, "switch back when 16.3.0 stable ships" has no owner.
Renovate may well raise the stable bump on its own; this is the note that
explains, at review time, why the exact pin was pre-release to begin with.
Test plan:
- bun scripts/prettier.ts --check CLAUDE.md: exit 0
- Documentation only; no code paths touched.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
justmadeid25 added a commit to justmadeid25/senecial that referenced this pull request Aug 6, 2026
Root cause: a confirmed upstream React/Next.js 16 bug
(vercel/next.js#86055, fixed by react/react#36134 in Next 16.3.0) leaves
useTransition's isPending permanently stuck whenever a Server Action
invoked inside startTransition also triggers a router revalidation
(revalidatePath and/or router.refresh). The follow-up RSC fetch is
silently reported net::ERR_ABORTED with no console error, so the client
never applies the update - confirmed via live browser console capture
showing the action resolving successfully while the DOM stayed frozen.
Upgraded next 16.2.12 -> 16.3.0 to pick up the fix, and removed the now-
redundant client-side router.refresh() in the upload form (revalidatePath
already refreshes the route from the action's own response).
This unblocked two previously-hidden, unrelated bugs that only had a
chance to run for the first time once the upload step stopped
cascading-failing every serial test after it:
- runExtractionWorker() (and any other test helper that shells out via
`dotenv -e .env.e2e`) never received the run-specific
tmp/e2e-storage/prod-{runId} directory the spawned server actually
wrote uploads to, only .env.e2e's static default - same bug class as
the already-fixed TEST_MAILBOX_DIR. Fixed by threading
LOCAL_STORAGE_PATH into the Playwright process env in run-e2e-prod.ts.
- A strict-mode Playwright locator matched two stacked toast
notifications in extraction-flow.spec.ts; fixed with .last().
Verified: extraction-flow.spec.ts, ai-conversation-flow.spec.ts, and
clause-intelligence-flow.spec.ts (the three specs that failed 100%
reproducibly in the Phase 12.5 Linux CI comparison) all now pass cleanly
without any per-component changes beyond the framework upgrade. Full
local suite passed 101/101 twice consecutively.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
reiorozco added a commit to reiorozco/next-supabase-take-home that referenced this pull request Aug 14, 2026
La segunda navegación cliente consecutiva sobre /coffee-health actualizaba la
URL pero dejaba el contenido congelado en el estado anterior, y los enlaces de
los chips, calculados a partir de ese estado obsoleto, resucitaban filtros ya
eliminados. El fallo es una regresión upstream, no del código de esta feature:
se reproduce con AutoSubmit ausente del build, usando solo enlaces planos.
Su origen es un bug de React canary (react/react#35821, corregido por
react/react#36134 el 2026-03-24) que Next.js empaqueta internamente. El
arreglo llegó a la línea canary via vercel/next.js#91905 pero nunca se retroportó
a la rama estable 16.2: toda la línea 16.2.x, incluida la última versión 16.2.12,
sigue empaquetando React 19.3.0-canary-3f0b9e61-20260317, anterior al arreglo.
16.3.x empaqueta 19.3.0-canary-cbb046ab-20260731, posterior. Se reporta en
vercel/next.js#92152 y vercel/next.js#92787.
Fija la versión de forma exacta en lugar de dejar el tag flotante "latest", para
que el arreglo no se revierta de forma silenciosa en una instalación futura.
react y react-dom no cambian: los rangos de peer dependencies de 16.3.1 son
idénticos a los de 16.2.6.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: useDeferredValue gets stuck with a stale value

3 participants

@gaearon@react-sizebot@acdlite
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); Fix useDeferredValue getting stuck by gaearon · Pull Request #36134 · react/react · GitHub
Skip to content

Fix useDeferredValue getting stuck - #36134

Merged
gaearon merged 3 commits into
mainfrom
fix-udv-stall
Mar 24, 2026
Merged

Fix useDeferredValue getting stuck#36134
gaearon merged 3 commits into
mainfrom
fix-udv-stall

Conversation

@gaearon

Copy link
Copy Markdown
Collaborator

Fixes#35821

Written/debugged by Claude.

Test Plan

@gaearon
gaearon requested a review from acdliteMarch 24, 2026 00:41
@github-actionsgithub-actionsBot added the React Core Team Opened by a member of the React Core Team label Mar 24, 2026
@react-sizebot

Copy link
Copy Markdown

Comparing: ed69815...df5ef86

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name+/-BaseCurrent+/- gzipBase gzipCurrent gzip
oss-stable/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-stable/react-dom/cjs/react-dom-client.production.js+0.01%612.81 kB612.88 kB=108.29 kB108.30 kB
oss-experimental/react-dom/cjs/react-dom.production.js=6.84 kB6.84 kB=1.88 kB1.88 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js=678.75 kB678.81 kB=119.25 kB119.26 kB
facebook-www/ReactDOM-prod.classic.js=698.14 kB698.20 kB=122.65 kB122.65 kB
facebook-www/ReactDOM-prod.modern.js=688.45 kB688.52 kB=121.02 kB121.03 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against df5ef86

@acdliteacdlite left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Is it a good or a bad thing that there was already a TODO that (sorta) described the issue 😆

Discussed out-of-band, writing here for posterity:

The TODO I think is still correct, we should generalize that special-error-to-unwind-the-stack trick thing that we use for selective hydration. The main benefit is that if you're mid render it can restart immediately instead of burning cycles on a work-in-progress render that will inevitably get thrown out regardless. Leaving for a future PR in case we were to accidentally introduce a new bug in the progress.

@gaearon
gaearon merged commit c0d218f into mainMar 24, 2026
245 checks passed
@gaearon
gaearon deleted the fix-udv-stall branch March 24, 2026 00:49
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit that referenced this pull request Mar 24, 2026
Fixes#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
github-actionsBot pushed a commit to code/lib-react that referenced this pull request Mar 25, 2026
Fixesreact#35821
Written/debugged by Claude.
## Test Plan
- Verify undoing the source fix fails the newly added test
- Verify building a bundle with the fix solves
https://github.com/gaearon/react-udv-bug/ repro
DiffTrain build for [c0d218f](react@c0d218f)
dhernz added a commit to dhernz/watcher-protocol that referenced this pull request May 1, 2026
- server.ts: viem-based USDC tipping on Base mainnet from EconomyOS-provisioned wallet
- Claude reasoning step: agent decides tip amount or skip with one-line rationale
- PagerDuty REST integration: fetch incidents, find linked PR, post note with tx hash
- GitHub REST: PR author lookup
- new endpoints: POST /demo/run · GET /api/agent · GET /api/fires
- CORS so the frontend on :8765 can call the backend on :3001
- 03-my-watchers.html wired to the backend: live "Fire demo" button, real fire list, wallet balance stat
- tip cap dropped to $0.03 USDC for cheap repeated demo runs
Verified end-to-end: incident created → PR detected (react/react#36134, @gaearon) →
Claude decided tip → on-chain tx 0x234771b5...3e26 on Base mainnet → note posted in PD.
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Jul 31, 2026
…#1740)
Next.js 16.3 changes `next/error`'s `ErrorInfo` shape twice over: `error`
becomes `unknown` and `unstable_retry` is renamed to `retry`. All 34
`error.tsx` / `global-error.tsx` files imported `ErrorInfo` directly, so the
bump would have had to touch every one of them in the same commit.
Route them through `src/shared/lib/errors/error-boundary-props.ts` instead.
`ErrorBoundaryProps` takes `error: unknown` with both retry props optional, so
either version's `ErrorInfo` is assignable to it and Next's generated route
type validation accepts the components on 16.2 and 16.3 alike. Upgrading then
edits one file: make `retry` required and drop the fallback.
Motivation: 16.3 carries the React fix for `useDeferredValue` getting stuck
(react/react#36134), which is what leaves admin save buttons disabled on
"保存中..." forever after a revalidating Server Action while the write itself
succeeds (vercel/next.js#86055). Measured here on /admin/settings/features:
Next 16.2.12 hangs 5/5, Next 16.3.0-preview.10 hangs 0/5.
This commit deliberately does not bump `next` — 16.3.0 stable is unreleased.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
…pending hang (#1786)
revalidate 付き Server Action の後にクライアントが RSC ペイロードを commit せず、
送信ボタンが pending のまま戻らない上流バグ(react/react#36134 /
vercel/next.js#86055)の修正を取り込む。React core メンテナが 2026-07-03 に
「react#36134 で修正、16.3.0 で出る」と述べて issue を close しており、
**16.2.x への backport は無い**(v16.2.12 が 16.2 系の最終リリース)。
## 本番の実害
admin がイベントを作成すると、実際は DB に作成できているのに「作成中...」の
スピナーが戻らない。二重送信や再読込を誘発する。revalidate + redirect する
admin mutation 全般が対象(スペース料金プラン更新でも同型を確認)。
## 実測
production build で `events-create-online.spec.ts` を 10 回試行:
| next | 失敗 | 所要時間 |
| ------------------ | ------ | --------------- |
| 16.2.12 | 2 / 10 | 2.8 〜 26.9 秒 |
| 16.3.0-preview.10 | 0 / 10 | 2.6 〜 4.8 秒 |
失敗時もサーバーは 303 を 127〜170ms で返し切っており、クライアントが適用しない
だけだった(POST 完了 → URL 反映は成功時 0.10〜0.26 秒 / 失敗時は 20 秒経っても
起きない二値)。
## 広域 E2E の対照実験(#1783 適用後)
| run | next | failed | flaky | passed |
| ----------- | ------------------ | ------ | ----- | ------ |
| 30686096541 | 16.2.12 | 1 | 1 | 325 |
| 30686085976 | 16.3.0-preview.10 | 1 | 1 | 325 |
形が同一で回帰は見られない。hard failure は両方とも既存の
`mypage-receipt-download`。flaky は互いに別 spec でどちらも初出のノイズ。
## コスト
**ソース変更ゼロ**。PR #1740 の `src/shared/lib/errors/error-boundary-props.ts`
seam が 16.3 の `ErrorInfo` 破壊的変更を吸収済み。バンドルは -532 kB(-16.7%)。
stable ではなく preview を採る判断: 16.3.0 stable が未リリースである一方、
本番の実害が継続しているため。本番デプロイは workflow_dispatch のみなので
merge しても自動では出ない。revert は package.json 1 行。
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
y2ikgm89 added a commit to y2ikgm89/myrrh-rental-space that referenced this pull request Aug 1, 2026
`package.json` pins `next` to `16.3.0-preview.10`, but the dependency pin table
listed only Bun / TypeScript / Zod / Lexical, so nothing in the repo said this is
a pre-release or that it is meant to be temporary.
PR #1786 documented the reasoning well — upstream React `useDeferredValue` stuck
bug (react/react#36134 / vercel/next.js#86055) leaving Server Action submit
buttons permanently pending in production, fixed only in 16.3.0 with no 16.2
backport — but a merged PR body is not somewhere anyone looks. Without a pointer
in the pin table, "switch back when 16.3.0 stable ships" has no owner.
Renovate may well raise the stable bump on its own; this is the note that
explains, at review time, why the exact pin was pre-release to begin with.
Test plan:
- bun scripts/prettier.ts --check CLAUDE.md: exit 0
- Documentation only; no code paths touched.
Co-authored-by: y2ikgm89 <y2ikgm89@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
justmadeid25 added a commit to justmadeid25/senecial that referenced this pull request Aug 6, 2026
Root cause: a confirmed upstream React/Next.js 16 bug
(vercel/next.js#86055, fixed by react/react#36134 in Next 16.3.0) leaves
useTransition's isPending permanently stuck whenever a Server Action
invoked inside startTransition also triggers a router revalidation
(revalidatePath and/or router.refresh). The follow-up RSC fetch is
silently reported net::ERR_ABORTED with no console error, so the client
never applies the update - confirmed via live browser console capture
showing the action resolving successfully while the DOM stayed frozen.
Upgraded next 16.2.12 -> 16.3.0 to pick up the fix, and removed the now-
redundant client-side router.refresh() in the upload form (revalidatePath
already refreshes the route from the action's own response).
This unblocked two previously-hidden, unrelated bugs that only had a
chance to run for the first time once the upload step stopped
cascading-failing every serial test after it:
- runExtractionWorker() (and any other test helper that shells out via
`dotenv -e .env.e2e`) never received the run-specific
tmp/e2e-storage/prod-{runId} directory the spawned server actually
wrote uploads to, only .env.e2e's static default - same bug class as
the already-fixed TEST_MAILBOX_DIR. Fixed by threading
LOCAL_STORAGE_PATH into the Playwright process env in run-e2e-prod.ts.
- A strict-mode Playwright locator matched two stacked toast
notifications in extraction-flow.spec.ts; fixed with .last().
Verified: extraction-flow.spec.ts, ai-conversation-flow.spec.ts, and
clause-intelligence-flow.spec.ts (the three specs that failed 100%
reproducibly in the Phase 12.5 Linux CI comparison) all now pass cleanly
without any per-component changes beyond the framework upgrade. Full
local suite passed 101/101 twice consecutively.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
reiorozco added a commit to reiorozco/next-supabase-take-home that referenced this pull request Aug 14, 2026
La segunda navegación cliente consecutiva sobre /coffee-health actualizaba la
URL pero dejaba el contenido congelado en el estado anterior, y los enlaces de
los chips, calculados a partir de ese estado obsoleto, resucitaban filtros ya
eliminados. El fallo es una regresión upstream, no del código de esta feature:
se reproduce con AutoSubmit ausente del build, usando solo enlaces planos.
Su origen es un bug de React canary (react/react#35821, corregido por
react/react#36134 el 2026-03-24) que Next.js empaqueta internamente. El
arreglo llegó a la línea canary via vercel/next.js#91905 pero nunca se retroportó
a la rama estable 16.2: toda la línea 16.2.x, incluida la última versión 16.2.12,
sigue empaquetando React 19.3.0-canary-3f0b9e61-20260317, anterior al arreglo.
16.3.x empaqueta 19.3.0-canary-cbb046ab-20260731, posterior. Se reporta en
vercel/next.js#92152 y vercel/next.js#92787.
Fija la versión de forma exacta en lugar de dejar el tag flotante "latest", para
que el arreglo no se revierta de forma silenciosa en una instalación futura.
react y react-dom no cambian: los rangos de peer dependencies de 16.3.1 son
idénticos a los de 16.2.6.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedReact Core TeamOpened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: useDeferredValue gets stuck with a stale value

3 participants

@gaearon@react-sizebot@acdlite