File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -174,11 +174,21 @@ async function generateFullComposite(
174
174
// To know the version to install, we will just have a peak to one of
175
175
// the miniapps, given that react native version is aligned across all.
176
176
const pJson = await readPackageJson ( localMiniAppsPaths [ 0 ] )
177
+ const miniAppRnVersion = pJson . dependencies [ 'react-native' ]
177
178
extraJsDependencies . push (
178
- PackagePath . fromString (
179
- `react-native@${ pJson . dependencies [ 'react-native' ] } `
180
- )
179
+ PackagePath . fromString ( `react-native@${ miniAppRnVersion } ` )
181
180
)
181
+ // If the version of RN < 0.60.0 we also need to add react dependency
182
+ // to the composite as it needs to be local to the bundler root for
183
+ // some reason (probably haste related).
184
+ // Otherwise bundling will fail to locate some react modules and throw
185
+ // 'Unable to resolve module ...' errors.
186
+ if ( semver . lte ( miniAppRnVersion , '0.60.0' ) ) {
187
+ extraJsDependencies . push (
188
+ PackagePath . fromString ( `react@${ pJson . dependencies . react } ` )
189
+ )
190
+ }
191
+
182
192
// Also add latest version of the bridge
183
193
extraJsDependencies . push (
184
194
PackagePath . fromString ( `react-native-electrode-bridge` )
You can’t perform that action at this time.
0 commit comments