From 689af6cd90350af25ce708657040f5300a1136e7 Mon Sep 17 00:00:00 2001 From: jshaofa-ui Date: Tue, 12 May 2026 21:23:48 +0800 Subject: [PATCH] Fix: ReactDOM.preloadModule crash with repeated custom as value The repeated custom-`as` path checks `moduleUnknownResources` but then reads the bucket from `unknownResources`, so the bucket can be undefined. Fixed by reading from `moduleUnknownResources` instead of `unknownResources` on line 6555 of ReactFizzConfigDOM.js. Fixes facebook/react#36440 --- packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js index 691e49e563fd..b273d9a89edb 100644 --- a/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js +++ b/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js @@ -6552,7 +6552,7 @@ function preloadModule( resumableState.moduleUnknownResources.hasOwnProperty(as); let resources; if (hasAsType) { - resources = resumableState.unknownResources[as]; + resources = resumableState.moduleUnknownResources[as]; if (resources.hasOwnProperty(key)) { // we can return if we already have this resource return;