Repository navigation
[flags] clean up enableAsyncDebugInfo - #37772
Merged
Merged
Conversation
eps1lon
approved these changes
Oct 7, 2026
rickhanlonii
force-pushed
the
rh/land-async-debug
branch
from
October 7, 2026 18:23
1404734 to
89c5747
Compare
eps1lon
approved these changes
Oct 7, 2026
eps1lon
pushed a commit
that referenced
this pull request
Oct 12, 2026
…37796) Fixes #37795 ## Summary In DEV, `trackUsedThenable` infers async debug info for a used thenable by attaching a `_debugInfo` expando: ```js if (__DEV__ && thenable._debugInfo === undefined) { ... thenable._debugInfo = [{awaited: ioInfo}]; // throws on non-extensible objects ``` If the thenable was made non-extensible — e.g. a userspace-instrumented thenable (one that already carries a `status`) frozen by an immutable cache before being passed to `use()` — the assignment throws `TypeError: Cannot add property _debugInfo, object is not extensible` from inside React, crashing the render in development while the same code works in production. Since #37772 landed the `enableAsyncDebugInfo` flag for OSS, this path runs for every `use(thenable)` call in DEV, so such thenables now crash where they previously unwrapped fine. This PR skips the debug-info inference when the thenable doesn't allow new properties, mirroring the existing guard for frozen values in Flight's `addAsyncInfo` (`ReactFlightClient.js`), which already skips `_debugInfo` for frozen values ("Debug info is dropped for frozen elements"). Debug info is simply dropped for such thenables; `use()` unwraps the value normally. Note: a *non-instrumented* frozen promise (`use(Object.freeze(promise))`) still hits the pre-existing `pendingThenable.status = 'pending'` assignment in the `default` branch, which requires a different fix (e.g. a WeakMap fallback) — I've flagged that separately in the issue. ## How did you test this change? - Added a regression test in `ReactUse-test.js` (frozen, userspace-instrumented thenable passed to `use()`), which fails on `main` with `TypeError: Cannot add property _debugInfo, object is not extensible` at `ReactFiberThenable.js:192` and passes with this fix. - `yarn test packages/react-reconciler` — 77 suites, 1147 tests passed. - `yarn test packages/react-reconciler/src/__tests__/ReactUse-test.js` in both dev and `--prod` modes — 51 tests passed each. - Related suites pass: `ReactSuspense-test.internal.js`, `ReactSuspenseWithNoopRenderer-test.js`, `ReactLazy-test.internal.js`, `ReactConditionalUseWarning-test.js`, `ReactFlightAsyncDebugInfo-test.js`. - `npx eslint` and `npx prettier --check` clean on both changed files; `yarn flow dom-node` passes. Co-authored-by: zhoubiao188 <[email protected]>
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 12, 2026
…37796) Fixes #37795 ## Summary In DEV, `trackUsedThenable` infers async debug info for a used thenable by attaching a `_debugInfo` expando: ```js if (__DEV__ && thenable._debugInfo === undefined) { ... thenable._debugInfo = [{awaited: ioInfo}]; // throws on non-extensible objects ``` If the thenable was made non-extensible — e.g. a userspace-instrumented thenable (one that already carries a `status`) frozen by an immutable cache before being passed to `use()` — the assignment throws `TypeError: Cannot add property _debugInfo, object is not extensible` from inside React, crashing the render in development while the same code works in production. Since #37772 landed the `enableAsyncDebugInfo` flag for OSS, this path runs for every `use(thenable)` call in DEV, so such thenables now crash where they previously unwrapped fine. This PR skips the debug-info inference when the thenable doesn't allow new properties, mirroring the existing guard for frozen values in Flight's `addAsyncInfo` (`ReactFlightClient.js`), which already skips `_debugInfo` for frozen values ("Debug info is dropped for frozen elements"). Debug info is simply dropped for such thenables; `use()` unwraps the value normally. Note: a *non-instrumented* frozen promise (`use(Object.freeze(promise))`) still hits the pre-existing `pendingThenable.status = 'pending'` assignment in the `default` branch, which requires a different fix (e.g. a WeakMap fallback) — I've flagged that separately in the issue. ## How did you test this change? - Added a regression test in `ReactUse-test.js` (frozen, userspace-instrumented thenable passed to `use()`), which fails on `main` with `TypeError: Cannot add property _debugInfo, object is not extensible` at `ReactFiberThenable.js:192` and passes with this fix. - `yarn test packages/react-reconciler` — 77 suites, 1147 tests passed. - `yarn test packages/react-reconciler/src/__tests__/ReactUse-test.js` in both dev and `--prod` modes — 51 tests passed each. - Related suites pass: `ReactSuspense-test.internal.js`, `ReactSuspenseWithNoopRenderer-test.js`, `ReactLazy-test.internal.js`, `ReactConditionalUseWarning-test.js`, `ReactFlightAsyncDebugInfo-test.js`. - `npx eslint` and `npx prettier --check` clean on both changed files; `yarn flow dom-node` passes. Co-authored-by: zhoubiao188 <[email protected]> DiffTrain build for [259980d](259980d)
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 12, 2026
…37796) Fixes #37795 ## Summary In DEV, `trackUsedThenable` infers async debug info for a used thenable by attaching a `_debugInfo` expando: ```js if (__DEV__ && thenable._debugInfo === undefined) { ... thenable._debugInfo = [{awaited: ioInfo}]; // throws on non-extensible objects ``` If the thenable was made non-extensible — e.g. a userspace-instrumented thenable (one that already carries a `status`) frozen by an immutable cache before being passed to `use()` — the assignment throws `TypeError: Cannot add property _debugInfo, object is not extensible` from inside React, crashing the render in development while the same code works in production. Since #37772 landed the `enableAsyncDebugInfo` flag for OSS, this path runs for every `use(thenable)` call in DEV, so such thenables now crash where they previously unwrapped fine. This PR skips the debug-info inference when the thenable doesn't allow new properties, mirroring the existing guard for frozen values in Flight's `addAsyncInfo` (`ReactFlightClient.js`), which already skips `_debugInfo` for frozen values ("Debug info is dropped for frozen elements"). Debug info is simply dropped for such thenables; `use()` unwraps the value normally. Note: a *non-instrumented* frozen promise (`use(Object.freeze(promise))`) still hits the pre-existing `pendingThenable.status = 'pending'` assignment in the `default` branch, which requires a different fix (e.g. a WeakMap fallback) — I've flagged that separately in the issue. ## How did you test this change? - Added a regression test in `ReactUse-test.js` (frozen, userspace-instrumented thenable passed to `use()`), which fails on `main` with `TypeError: Cannot add property _debugInfo, object is not extensible` at `ReactFiberThenable.js:192` and passes with this fix. - `yarn test packages/react-reconciler` — 77 suites, 1147 tests passed. - `yarn test packages/react-reconciler/src/__tests__/ReactUse-test.js` in both dev and `--prod` modes — 51 tests passed each. - Related suites pass: `ReactSuspense-test.internal.js`, `ReactSuspenseWithNoopRenderer-test.js`, `ReactLazy-test.internal.js`, `ReactConditionalUseWarning-test.js`, `ReactFlightAsyncDebugInfo-test.js`. - `npx eslint` and `npx prettier --check` clean on both changed files; `yarn flow dom-node` passes. Co-authored-by: zhoubiao188 <[email protected]> DiffTrain build for [259980d](259980d)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this is landed everywhere