Nitro Views: Using union types for enums fails to build on Swift with Swift IR issues
How were you trying to build the app?
When adding the spec for Lottie, i noticed that when i use unions for the type of a spec's prop (Say type ResizeMode = 'cover' | 'contain' | 'center' and then i have a prop in spec that adheres to this), it generates the Swift code and Kotlin codes and even runs correctly on Android, but on iOS, it throws a compiler error when trying to build the app, basically pointing to the cxx mapping and saying that it failed to generate IR code.
I have not tried classic TypeScript enums yet, figured i send this up first and then go back to messing around.
The reproducible is this commit on the lottie repo: https://github.com/lottie-react-native/lottie-react-native/pull/1336/commits/c1e5d7b35278324f3ef1ca5be5977d720f8a0864
I did read the contribution guide, but since the Repro is already a monorepo, didn't want to exactly find out how yarn would react to a workspace in a workspace and if it would make the bug even harder to see due to something else because of the monorepo. I know it is a pain in the ass to pull random people's repos in. If it is not ok, i can try to add it to this setup as well, just let me know.
Here is the xcresult for the run if all else fails Build LottieReactNativeExample_2025-04-06T10-11-56.xcresult.zip
Xcode 16.2 (16C5032a) Swift 6.0.3
Full build logs
This is what xcode returns for the error. There is no more info beyond this coming from the compiler, just this one item:
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/swift/ColorFilterStruct.swift /Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/swift/Func_void.swift /Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/swift/Func_void_bool.swift /Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/swift/Func_void_std__string.swift /Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/swift/HybridLottieAnimationViewSpec.swift -primary-file /Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/swift/HybridLottieAnimationViewSpec_cxx.swift /Users/parsascontentcorner/Desktop/lottie-react-native/ios/LottieAnimationViewPropertyManager.swift /Users/parsascontentcorner/Desktop/lottie-react-native/ios/LottieReactNative.swift /Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/LottieReactNativeAutolinking.swift /Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/swift/RenderMode.swift /Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/swift/ResizeMode.swift /Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/swift/TextFilterAndroidStruct.swift /Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/swift/TextFilterIOSStruct.swift -emit-dependencies-path /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/Objects-normal/arm64/HybridLottieAnimationViewSpec_cxx.d -emit-const-values-path /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/Objects-normal/arm64/HybridLottieAnimationViewSpec_cxx.swiftconstvalues -emit-reference-dependencies-path /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/Objects-normal/arm64/HybridLottieAnimationViewSpec_cxx.swiftdeps -serialize-diagnostics-path /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/Objects-normal/arm64/HybridLottieAnimationViewSpec_cxx.dia -target arm64-apple-ios16.6-simulator -Xllvm -aarch64-use-tbi -enable-objc-interop -cxx-interoperability-mode=default -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk -I /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Products/Debug-iphonesimulator/LottieReactNative -I /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Products/Debug-iphonesimulator/NitroModules -I /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Products/Debug-iphonesimulator/lottie-ios -F /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Products/Debug-iphonesimulator/LottieReactNative -F /Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/hermes-engine/destroot/Library/Frameworks/universal -F /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/hermes-engine/Pre-built -no-color-diagnostics -enable-testing -g -debug-info-format=dwarf -dwarf-version=4 -import-underlying-module -module-cache-path /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D DEBUG -D COCOAPODS -D RCT_NEW_ARCH_ENABLED -serialize-debugging-options -const-gather-protocols-file /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/Objects-normal/arm64/LottieReactNative_const_extract_protocols.json -enable-experimental-feature DebugDescriptionMacro -enable-experimental-feature OpaqueTypeErasure -enable-bare-slash-regex -empty-abi-descriptor -validate-clang-modules-once -clang-build-session-file /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc /Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir /Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods -Xcc -fmodule-map-file=/Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Products/Debug-iphonesimulator/NitroModules/NitroModules.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Products/Debug-iphonesimulator/lottie-ios/Lottie.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/DoubleConversion/DoubleConversion.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/RCTDeprecation/RCTDeprecation.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/RCTFabric/React-RCTFabric.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React/React-Core.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/ReactCodegen/ReactCodegen.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/ReactCommon/ReactCommon.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React_Fabric/React-Fabric.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React_FabricComponents/React-FabricComponents.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React_NativeModulesApple/React-NativeModulesApple.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React_RCTAppDelegate/React-RCTAppDelegate.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/folly/RCT-Folly.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/glog/glog.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/jsi/React-jsi.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/jsinspector_modern/React-jsinspector.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/jsinspector_modern_tracing/React-jsinspectortracing.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/react_debug/React-debug.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/react_featureflags/React-featureflags.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/react_nativemodule_defaults/React-defaultsnativemodule.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/react_nativemodule_dom/React-domnativemodule.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/react_nativemodule_featureflags/React-featureflagsnativemodule.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/react_nativemodule_idlecallbacks/React-idlecallbacksnativemodule.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/react_nativemodule_microtasks/React-microtasksnativemodule.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/react_renderer_debug/React-rendererdebug.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/react_renderer_graphics/React-graphics.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/react_renderer_imagemanager/React-ImageManager.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/react_utils/React-utils.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/yoga/Yoga.modulemap -Xcc -fmodule-map-file=/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/LottieReactNative/LottieReactNative.modulemap -Xcc -std=c++20 -Xcc -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG -Xcc -ivfsstatcache -Xcc /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-07b28473f605e47e75261259d3ef3b5a.sdkstatcache -Xcc -I/Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/LottieReactNative-generated-files.hmap -Xcc -I/Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/LottieReactNative-own-target-headers.hmap -Xcc -I/Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/LottieReactNative-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Pods-8699adb1dd336b26511df848a716bd42-VFS-iphonesimulator/all-product-headers.yaml -Xcc -iquote -Xcc /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/LottieReactNative-project-headers.hmap -Xcc -I/Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Products/Debug-iphonesimulator/LottieReactNative/include -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Private -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Private/LottieReactNative -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/DoubleConversion -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/FBLazyVector -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/RCT-Folly -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/RCTRequired -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/RCTTypeSafety -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-Core -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-Fabric -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-FabricComponents -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-FabricImage -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-ImageManager -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-Mapbuffer -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-NativeModulesApple -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-RCTBlob -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-RCTFBReactNativeSpec -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-RCTFabric -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-RCTText -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-RuntimeApple -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-RuntimeCore -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-RuntimeHermes -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-callinvoker -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-cxxreact -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-debug -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-defaultsnativemodule -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-domnativemodule -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-featureflags -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-featureflagsnativemodule -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-graphics -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-hermes -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-idlecallbacksnativemodule -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-jserrorhandler -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-jsi -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-jsiexecutor -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-jsinspector -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-jsinspectortracing -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-logger -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-microtasksnativemodule -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-perflogger -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-performancetimeline -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-rendererconsistency -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-rendererdebug -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-runtimeexecutor -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-runtimescheduler -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-timing -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/React-utils -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/ReactCodegen -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/ReactCommon -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/Yoga -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/boost -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/fast_float -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/fmt -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/glog -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Public/hermes-engine -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/boost -Xcc -I/Users/parsascontentcorner/Desktop/lottie-react-native/example/ios/Pods/Headers/Private/Yoga -Xcc -I/Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/DerivedSources-normal/arm64 -Xcc -I/Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/DerivedSources/arm64 -Xcc -I/Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG=1 -Xcc -DDEBUG=1 -Xcc -DCOCOAPODS=1 -module-name LottieReactNative -frontend-parseable-output -disable-clang-spi -target-sdk-version 18.2 -target-sdk-name iphonesimulator18.2 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/LottieReactNative.build/Objects-normal/arm64/HybridLottieAnimationViewSpec_cxx.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/LottieReactNative.build/Objects-normal/arm64/HybridLottieAnimationViewSpec_cxx.o -index-store-path /Users/parsascontentcorner/Library/Developer/Xcode/DerivedData/LottieReactNativeExample-cidzhadssnvjbpfdlhgomzbmzwqk/Index.noindex/DataStore -index-system-modules
1. Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
2. Compiling with effective version 5.10
3. While evaluating request IRGenRequest(IR Generation for file "/Users/parsascontentcorner/Desktop/lottie-react-native/nitrogen/generated/ios/swift/HybridLottieAnimationViewSpec_cxx.swift")
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 swift-frontend 0x0000000105f9aa9c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 swift-frontend 0x0000000105f98cf0 llvm::sys::RunSignalHandlers() + 112
2 swift-frontend 0x0000000105f9b068 SignalHandler(int) + 292
3 libsystem_platform.dylib 0x000000018ea83624 _sigtramp + 56
4 swift-frontend 0x00000001033f1724 clang::CodeGen::ConstantAggregateBuilderBase::getRelativeOffsetToPosition(llvm::IntegerType*, llvm::Constant*, unsigned long) + 176
5 swift-frontend 0x00000001033f1724 clang::CodeGen::ConstantAggregateBuilderBase::getRelativeOffsetToPosition(llvm::IntegerType*, llvm::Constant*, unsigned long) + 176
6 swift-frontend 0x000000010100e908 swift::irgen::IRGenModule::getAddrOfStringForTypeRef(swift::irgen::SymbolicMangling const&, swift::irgen::MangledTypeRefRole) + 1416
7 swift-frontend 0x0000000100ed7ef8 getTypeRefImpl(swift::irgen::IRGenModule&, swift::CanType, swift::CanGenericSignature, swift::irgen::MangledTypeRefRole) + 1136
8 swift-frontend 0x0000000100edd2c0 ReflectionMetadataBuilder::addTypeRef(swift::CanType, swift::CanGenericSignature, swift::irgen::MangledTypeRefRole) + 72
9 swift-frontend 0x0000000100edcd50 FixedTypeMetadataBuilder::layout() + 172
10 swift-frontend 0x0000000100edd7c8 ReflectionMetadataBuilder::emit(std::__1::optional<llvm::function_ref<llvm::Constant* (swift::irgen::IRGenModule&, swift::irgen::ConstantInit)>>, char const*) + 48
11 swift-frontend 0x0000000100edaf7c swift::irgen::IRGenModule::emitFieldDescriptor(swift::NominalTypeDecl const*) + 1460
12 swift-frontend 0x0000000100dcb19c swift::irgen::IRGenerator::emitLazyDefinitions() + 3172
13 swift-frontend 0x0000000100f35680 swift::IRGenRequest::evaluate(swift::Evaluator&, swift::IRGenDescriptor) const + 4916
14 swift-frontend 0x0000000100f7dba8 swift::SimpleRequest<swift::IRGenRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::IRGenRequest const&, swift::Evaluator&) + 176
15 swift-frontend 0x0000000100f3e394 swift::IRGenRequest::OutputType swift::Evaluator::getResultUncached<swift::IRGenRequest, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()>(swift::IRGenRequest const&, swift::IRGenRequest::OutputType swift::evaluateOrFatal<swift::IRGenRequest>(swift::Evaluator&, swift::IRGenRequest)::'lambda'()) + 784
16 swift-frontend 0x0000000100f37e90 swift::performIRGeneration(swift::FileUnit*, swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::GlobalVariable**) + 180
17 swift-frontend 0x00000001009474bc generateIR(swift::IRGenOptions const&, swift::TBDGenOptions const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, llvm::GlobalVariable*&, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>) + 156
18 swift-frontend 0x0000000100942ce4 performCompileStepsPostSILGen(swift::CompilerInstance&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule>>, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 2176
19 swift-frontend 0x0000000100941bd0 swift::performCompileStepsPostSema(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 984
20 swift-frontend 0x0000000100944e88 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 1684
21 swift-frontend 0x0000000100943bb4 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3572
22 swift-frontend 0x00000001008caa5c swift::mainEntry(int, char const**) + 3680
23 dyld 0x000000018e6aab4c start + 6000
Project dependencies
The libraries deps:
"peerDependencies": {
"react": "*",
"react-native": "*",
"react-native-nitro-modules": "^0.25.2"
},
"dependencies": {
"color": "^5.0.0"
},
"devDependencies": {
"@commitlint/config-conventional": "^19.6.0",
"@eslint/compat": "^1.2.7",
"@eslint/eslintrc": "^3.3.0",
"@eslint/js": "^9.22.0",
"@evilmartians/lefthook": "^1.5.0",
"@react-native/eslint-config": "^0.78.0",
"@release-it/conventional-changelog": "^9.0.2",
"@types/jest": "^29.5.5",
"@types/react": "^19.0.0",
"commitlint": "^19.6.1",
"del-cli": "^5.1.0",
"eslint": "^9.22.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-prettier": "^5.2.3",
"jest": "^29.7.0",
"nitro-codegen": "^0.25.2",
"prettier": "^3.0.3",
"react": "19.0.0",
"react-native": "0.78.2",
"react-native-builder-bob": "^0.40.0",
"react-native-nitro-modules": "^0.25.2",
"release-it": "^17.10.0",
"turbo": "^1.10.7",
"typescript": "^5.2.2"
},
The example app's deps:
"dependencies": {
"react": "19.0.0",
"react-native": "0.78.2",
"react-native-nitro-modules": "^0.25.2"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "15.0.1",
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native/babel-preset": "0.78.2",
"@react-native/metro-config": "0.78.2",
"@react-native/typescript-config": "0.78.2",
"@types/react": "^19.0.0",
"react-native-builder-bob": "^0.40.0"
},
Nitro Modules Version
0.25.2
Nitrogen Version
0.25.2
Target platforms
iOS
Operating system
MacOS
Can you build the Nitro Modules Example app?
Yes, I can successfully build the Example app here
Additional information
- [ ] I am using Expo
- [x] I am using Nitrogen (nitro-codegen)
- [x] I have read and followed the Troubleshooting Guide.
- [ ] I created a reproduction PR to reproduce this issue here in the nitro repo. (See Contributing for more information)
- [x] I searched for similar issues in this repository and found none.
It points to HybridLottieAnimationViewSpec_cxx when it fails to compile
Also let me know if you just prefer that i report this to Apple and link it in this issue for future tracking?
Using Type script enums, i get a different but no less interesting error:
This is strange as the function signature matches on both ends as far as i see it.
oof - this definitely is a Swift compiler bug. Did you create an Apple Bug Report (feedback assistant) and Swift compiler bug (GitHub repo)?
Can you maybe command-click on bridge.std__optional_RenderMode_?
Also did you upload the logs you get in the window shown in the Troubleshooting guide
the Troubleshooting guide
Yep, that is the Full build logs uploaded above (that is basically all it had, no other errors above it) and i also uploaded the xcresult so it can be opened in Xcode with all the messages, warnings etc (side note, might be a good idea to update the trouble shooting guide to just ask people to export that, since it has basically everything)
oof - this definitely is a Swift compiler bug. Did you create an Apple Bug Report (feedback assistant) and Swift compiler bug (GitHub repo)?
Haven't yet, will do later today once i have a bit more free time
ah got it!
I haven't looked at your repro yet - but aren't you doing exactly the same as the TestView.nitro.ts in the example in the repo here? It's also just an enum on the view as a prop:
https://github.com/mrousavy/nitro/blob/6957f31e5f65594e6080f2bdb24a7d85ba5b0a2e/packages/react-native-nitro-image/src/specs/TestView.nitro.ts#L11
..and this works perfectly fine..?
I never tried building the HybridView stuff of this repo with my local Xcode, just the normal nitro module. Maybe this is yet another bug with Xcode 16.2, i'll check it and report back
Ok, bit of Egg on my face, the version of the nitro repo i had was very old, from when you first released it and i was trying it out so it didn't even have Nitro views. I recloned it and built the iOS app, and it compiled ok:
Build NitroExample_2025-04-09T07-30-59.xcresult.zip
However when i run bun start in the example app i get this:
So can't validate end to end that it works, but at the very least it compiles.
This is what bridge.std__optional_RenderMode_ looks like:
// pragma MARK: std::optional<RenderMode>
/**
* Specialized version of `std::optional<RenderMode>`.
*/
using std__optional_RenderMode_ = std::optional<RenderMode>;
inline std::optional<RenderMode> create_std__optional_RenderMode_(const RenderMode& value) {
return std::optional<RenderMode>(value);
}
Comparing the example nitro image view with Lottie, the main difference is that the union type was an optional prop on Lottie but non-optional on the nitro image view. When i made Lottie's prop non-optional, it also compiled just fine. So i guess the problem is having an optional union type
Okay so
- The upper bug seems unrelated, maybe a npm/bun issue
- I will take a look at optional enums - usually (in native languages) you'd want to avoid optionals and just have a default value though. But I can fix it nevertheless
Okay so
- The upper bug seems unrelated, maybe a npm/bun issue
- I will take a look at optional enums - usually (in native languages) you'd want to avoid optionals and just have a default value though. But I can fix it nevertheless
Yeah, was thinking that worse comes worse, i go the usual route of defining an UNKNOWN/NOT_SET param on the type, the internal API surface is different from it's external user facing one anyway, so it works just fine. That is probably what i will do for now. Appreciate you looking into it Marc. Let me know if you find out something fun or if you need anything more on this side❤️
Hey - I think I fixed this in https://github.com/mrousavy/nitro/pull/679 - can you check if this works?
Hey - closing since I think this is fixed. Lmk if you encounter this issue again!