-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Describe the bug
iOS build fails during React Native codegen with the error Union types are unsupported in structs. The failure occurs when installing pods or building the iOS app after adding the dependency that triggers codegen.
To Reproduce
Steps to reproduce the behavior:
- Create or open a React Native app managed by Expo
- Install the package
@google/react-native-make-payment - Run
npx expo prebuild -p ios - Run
cd ios && pod install - Build the app with
npx expo run:iosorxcodebuild - See the build fail during codegen with the error shown below
Expected behavior
The iOS app should build successfully. Codegen should complete without errors and the module should be compiled and linked.
Screenshots
N/A
Desktop (please complete the following information):
- OS: macOS
- Browser: N/A
- Version: N/A
Smartphone (please complete the following information):
- Device: iPhone simulator and physical device
- OS: iOS
- Browser: N/A
- Version: N/A
Additional context
-
React Native: 0.76.9
-
Expo SDK: 52.0.0
-
Platform: iOS only, Android builds succeed
-
Pods step reference from
ios/Podfile:# from /Users/samyu/Moreta/moreta-mobile/ios/Podfile:41 use_react_native!( # :path => config[:reactNativePath], ) -
Full error log:
Error: Union types are unsupported in structs at StructCollector.process (/Users/samyu/Moreta/moreta-mobile/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/StructCollector.js:194:15) at /Users/samyu/Moreta/moreta-mobile/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/StructCollector.js:223:32 at Array.map (<anonymous>) at StructCollector._insertStruct (/Users/samyu/Moreta/moreta-mobile/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/StructCollector.js:217:56) at StructCollector._insertAlias (/Users/samyu/Moreta/moreta-mobile/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/StructCollector.js:203:12) at StructCollector.process (/Users/samyu/Moreta/moreta-mobile/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/StructCollector.js:186:14) at /Users/samyu/Moreta/moreta-mobile/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/StructCollector.js:223:32 at Array.map (<anonymous>) at StructCollector._insertStruct (/Users/samyu/Moreta/moreta-mobile/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/StructCollector.js:217:56) at StructCollector._insertAlias (/Users/samyu/Moreta/moreta-mobile/node_modules/@react-native/codegen/lib/generators/modules/GenerateModuleObjCpp/StructCollector.js:203:12) -
This appears related to React Native codegen handling of union types inside a struct in a TurboModule spec or types used by the affected package. A similar report is here: Union types are unsupported in structs mkuczera/react-native-haptic-feedback#127
Minimal repro notes