Skip to content

Static Assertion Failed on C++ __parsed_specifications in iOS Simulator Build #52638

@Tuberose621

Description

@Tuberose621

Description

When I integrated React Native v0.80.0 into a native iOS project using the new architecture (Fabric + TurboModule) and enabled code generation, I encountered a runtime assertion failure when the app started. I followed the official documentation to implement it: https://reactnative.dev/docs/turbo-native-modules-introduction?platforms=ios. But every time I build, the build fails in my project. And the error is: Static assertion failed due to requirement 'sizeof(std::__format_spec::__parsed_specifications<char>) == 16'. It works every time. But I use the official template demo and implement it according to the documentation, and there will be no error. Another way is to transfer the implementation code to a private library and set c++17. The build will succeed, but this is unscientific and very troublesome. I tried many methods and dealt with it for many days, but I didn't completely solve this problem.

Please help me!!!

Steps to reproduce

1.Create a React Native 0.80.0 app integrated with an existing iOS native project.
2.Enable new architecture (Fabric + TurboModule).
3.Use ReactCodegen to generate native modules with .ts spec files like:

export interface Spec extends TurboModule {
  readonly myMethod: () => Promise<void>;
}

4.Configure Podfile and Podspec like the official template.
5.Compile with -std=c++20 (default from RN 0.80.0).
6.Run the app → crash or assertion failure observed.

Error Observed

static_assert(sizeof(__parsed_specifications) == 16); // evaluated as 14 == 16

React Native Version

0.80.0

Affected Platforms

Runtime - iOS

Areas

TurboModule - The New Native Module System

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.5
  CPU: (12) arm64 Apple M4 Pro
  Memory: 148.44 MB / 24.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.16.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.9.2
    path: /usr/local/bin/npm
  Watchman:
    version: 2025.05.26.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/congying/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java: Not Found
  Ruby:
    version: 3.2.2
    path: /Users/congying/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 19.0.0
    wanted: 19.0.0
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.80.0
    wanted: 0.80.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

Showing Recent Errors Only
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/parser_std_format_spec.h:323:15: Static assertion failed due to requirement 'sizeof(std::__format_spec::__parsed_specifications<char>) == 16'


Showing Recent Errors Only
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/parser_std_format_spec.h:323:15: in file included from /Users/congying/Desktop/Gecongying/workspace/iOS/zg-yzt-rn/zg-yzt-pro-app-ios/ZGJYS/RNMarketData/NativeMarketDataBridge/RCTNativeMarketData.mm:8:


Showing Recent Errors Only
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/parser_std_format_spec.h:323:15: in file included from /Users/congying/Desktop/Gecongying/workspace/iOS/zg-yzt-rn/zg-yzt-pro-app-ios/ZGJYS/RNMarketData/NativeMarketDataBridge/RCTNativeMarketData.h:9:


Showing Recent Errors Only
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/parser_std_format_spec.h:323:15: in file included from /Users/congying/Library/Developer/Xcode/DerivedData/ZGJYS-bhmahvbghdnkzgeixwxcqaehoczj/Build/Products/Debug-iphonesimulator/ReactCodegen/ReactCodegen.framework/Headers/NativeBridgeSpecs/NativeBridgeSpecs.h:24:


Showing Recent Errors Only
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/parser_std_format_spec.h:323:15: in file included from /Users/congying/Library/Developer/Xcode/DerivedData/ZGJYS-bhmahvbghdnkzgeixwxcqaehoczj/Build/Products/Debug-iphonesimulator/RCTTypeSafety/RCTTypeSafety.framework/Headers/RCTConvertHelpers.h:10:


Showing Recent Errors Only
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/parser_std_format_spec.h:323:15: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/vector:325:


Showing Recent Errors Only
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/parser_std_format_spec.h:323:15: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/formatter_bool.h:20:


Showing Recent Errors Only
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/parser_std_format_spec.h:323:15: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/formatter_integral.h:21:


Showing Recent Errors Only
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/parser_std_format_spec.h:323:15: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.2.sdk/usr/include/c++/v1/__format/formatter_output.h:22:

MANDATORY Reproducer

export default TurboModuleRegistry.getEnforcing('NativeMarketData')

Screenshots and Videos

Image Image Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.Platform: iOSiOS applications.Type: New ArchitectureIssues and PRs related to new architecture (Fabric/Turbo Modules)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions