Skip to content

RN 0.85 / Expo SDK 56: iOS build fails — Builder struct missing 'ResultT' typedef in pre-generated codegen #249

@istvan-panczel

Description

@istvan-panczel

Environment

  • react-native-esc-pos-printer: 4.5.0
  • React Native: 0.85.3
  • Expo SDK: 56
  • iOS, New Architecture enabled

Problem

After upgrading to RN 0.85 (Expo SDK 56), the iOS Pods build fails while compiling react-native-esc-pos-printer:

  ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTTypedModuleConstants.h:62:28
    > 62 |   using type = typename T::ResultT;
         |                            ^ no type named 'ResultT' in 'JS::NativeEscPosPrinter::Constants::Builder'

  ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety/RCTTypedModuleConstants.h:62:28
    > 62 |   using type = typename T::ResultT;
         |                            ^ no type named 'ResultT' in 'JS::NativeEscPosPrinterDiscovery::Constants::Builder'

Root cause

RN 0.85 introduced a new RCTTypedModuleConstants.h template that resolves a Builder to its parent Constants type via
T::ResultT:

// In RN 0.85's RCTTypedModuleConstants.h:
 template <typename T>
 struct ResolveConstantsType<T, true> {
   // Use T::ResultT which points to the parent Constants type (added by codegen)
   using type = typename T::ResultT;
 };

The package ships pre-generated codegen output (codegenConfig.includesGeneratedCode: true, in
ios/generated/RNEscPosPrinterSpec/RNEscPosPrinterSpec.h), so codegen never re-runs against the consumer's RN version.
That shipped output was produced by an older codegen and does not define ResultT inside the Builder structs, so the
build fails on any RN 0.85 consumer.

Both JS::NativeEscPosPrinter::Constants::Builder and JS::NativeEscPosPrinterDiscovery::Constants::Builder are affected.

Suggested fix

Add using ResultT = Constants; inside each Builder struct in ios/generated/RNEscPosPrinterSpec/RNEscPosPrinterSpec.h —
that's what RN 0.85's codegen would now emit. Alternatively, regenerate the shipped codegen against RN 0.85.

Patch attached (the prefilled diff below).

Workaround

Until a release is published, consumers can use patch-package with the attached diff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions