From 579212e15c9197d6c614cfeb4561e4a85956ee3b Mon Sep 17 00:00:00 2001 From: Fabrizio Cucci Date: Wed, 16 Sep 2026 13:36:44 +0100 Subject: [PATCH] Restore .js fallback for legacy deep imports of untyped modules Relocating the hand-written declarations under types_DEPRECATED/ (#57513) changed where the react-native-legacy-deep-imports export condition points for ./Libraries/*. It used to resolve to ./Libraries/*.d.ts, beside the real .js, so TypeScript's extension substitution still found modules with no hand-written declaration. It now resolves into types_DEPRECATED/, which contains no .js files, so those specifiers stop resolving. Reported against 0.88.0-rc.0 with react-native/Libraries/Core/InitializeCore. Add the old location as a second entry so the condition falls back to it. Modules that do have a declaration keep resolving to types_DEPRECATED/ because that entry is still first. This is applied to 0.88-stable only. 0.88 is a non-breaking release, so the regression must not ship in it. main intentionally keeps the current behaviour pending a deliberate decision on retiring deep imports. --- packages/react-native/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 292a7e7b716..78885480ced 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -34,7 +34,10 @@ "default": "./index.js" }, "./Libraries/*": { - "react-native-legacy-deep-imports": "./types_DEPRECATED/Libraries/*.d.ts", + "react-native-legacy-deep-imports": [ + "./types_DEPRECATED/Libraries/*.d.ts", + "./Libraries/*.d.ts" + ], "types": null, "default": "./Libraries/*.js" },