Skip to content

Commit e350859

Browse files
tido64facebook-github-bot
authored andcommitted
fix: cannot find module react-native-*/Libraries/Core/InitializeCore (#42875)
Summary: `react-native/community-cli-plugin` is unable to resolve out-of-tree platforms in monorepos because the package may not be hoisted to the same location. For example, if `react-native/community-cli-plugin` was hoisted: ``` /~/node_modules/react-native/community-cli-plugin/dist/utils ``` It may never find `react-native-macos` if it wasn't hoisted: ``` /~/packages/my-app/node_modules/react-native-macos ``` ## Changelog: [GENERAL] [FIXED] - Fix `react-native/community-cli-plugin` is unable to resolve out-of-tree platforms in monorepos Pull Request resolved: #42875 Test Plan: Tested in an internal project. Reviewed By: cipolleschi Differential Revision: D53426607 Pulled By: robhogan fbshipit-source-id: 29b9fe92d5773d0160bba375d2e92ec688652e3e
1 parent 48a19d7 commit e350859

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/community-cli-plugin/src/utils/loadMetroConfig.js

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ function getOverrideConfig(
6666
...outOfTreePlatforms.map(platform =>
6767
require.resolve(
6868
`${ctx.platforms[platform].npmPackageName}/Libraries/Core/InitializeCore`,
69+
{paths: [ctx.root]},
6970
),
7071
),
7172
],

0 commit comments

Comments
 (0)