You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: use() crashes in DEV with TypeError: Cannot add property _debugInfo when the thenable is frozen/non-extensible #37795
React version: main @ b618bbb (and 19.2.0, where the underlying code first ships in an OSS release via #37772)
Steps To Reproduce
Pass a non-extensible thenable whose status was already set by a userspace implementation to use() in a development build:
// e.g. a Suspense-compatible library that pre-instrumented its promise,// and a cache that freezes entries before sharing themconstthenable=Promise.resolve('Hi');thenable.status='fulfilled';thenable.value='Hi';Object.freeze(thenable);functionChild(){return<Texttext={use(thenable)}/>;}
Link to code example: minimal repro above (also added as a regression test in the linked PR)
The current behavior
The render crashes with a TypeError thrown from React internals:
TypeError: Cannot add property _debugInfo, object is not extensible
at trackUsedThenable (react-dom/cjs/react-dom-client.development.js:…)
The error points into React, not at any user code, and takes down the whole render in DEV. In production the same code works fine, so the failure mode is DEV/PROD divergence.
The expected behavior
Debug-info instrumentation should never crash a user's render. When the thenable doesn't allow new properties, React should skip attaching the inferred _debugInfo (debug info is simply dropped for that thenable) and use() should unwrap the value normally — matching the existing guard in addAsyncInfo (ReactFlightClient.js), which already skips _debugInfo for frozen values with a "Debug info is dropped for frozen elements" comment.
Analysis
trackUsedThenable (packages/react-reconciler/src/ReactFiberThenable.js) does, in DEV:
if(__DEV__&&thenable._debugInfo===undefined){
...
thenable._debugInfo=[{awaited: ioInfo}];// throws on frozen/sealed/non-extensible
Two notes on scope:
This is a regression for OSS builds: the enableAsyncDebugInfo flag was landed in [flags] clean up enableAsyncDebugInfo #37772 (2026-10-07), so this code path now runs for everyuse(thenable) call in DEV. Before that commit, an instrumented frozen thenable took the case 'fulfilled' / 'rejected' / typeof status === 'string' paths and worked fine.
A non-instrumented frozen promise (use(Object.freeze(promise))) already crashed before this change at the pendingThenable.status = 'pending' assignment in the default branch — that's a separate, pre-existing issue (React can't attach its status expando either, and would need a WeakMap-based fallback). This report is only about the debug-info expando, which is purely for instrumentation and can always be skipped safely.
Happy to send a PR that skips the debug-info inference when Object.isExtensible(thenable) is false, with a regression test.
Activity
[Fiber] Fix DEV crash when use() is passed a non-extensible thenable (#…
[Fiber] Fix DEV crash when use() is passed a non-extensible thenable (#…
[Fiber] Fix DEV crash when use() is passed a non-extensible thenable (#…