Skip to content

New Architecture (RN 0.81 / Expo SDK 54): missing shadowNodeFromValue causes iOS Fabric build failure #3730

@jj-devs

Description

@jj-devs

Description

When building with Expo SDK 54 (React Native 0.81.4) + New Architecture enabled, the iOS build fails in the RNGestureHandler Fabric module. shadowNodeFromValue is undefined because REACT_NATIVE_MINOR_VERSION is not defined, so the iOS helper never compiles. As a result Fastlane/Xcode exits with:

  • use of undeclared identifier 'shadowNodeFromValue'; did you mean 'shadowNodeListFromValue'?
  • no member named 'getTraits' in 'std::vector<std::shared_ptr>'
  • 'std::vector<std::shared_ptr>' is not polymorphic

Environment

  • Expo SDK 54.0.12
  • React Native 0.81.4
  • react-native-gesture-handler 2.25.0
  • react-native-reanimated 4.1.2
  • iOS build via EAS (fastlane)
  • RCT_NEW_ARCH_ENABLED=1 / EXPO_NEW_ARCH_ENABLED=1

Expected Result

Build succeeds with RNGestureHandler + Fabric under the New Architecture.

Actual Result

Build fails at “Install pods” / “Run fastlane” with the compiler errors listed above.

Workaround

Adding both a fallback for REACT_NATIVE_MINOR_VERSION and a local shadowNodeFromValue helper fixes the build. The minimal change we use today:

// [cpp-adapter.cpp](http://_vscodecontentref_/0)  (same idea in iOS functions.mm)

#ifndef REACT_NATIVE_MINOR_VERSION
#define REACT_NATIVE_MINOR_VERSION 81
#endif

#include <react/renderer/bridging/Bridging.h>

#if REACT_NATIVE_MINOR_VERSION >= 81
static inline std::shared_ptr<const ShadowNode> shadowNodeFromValue(
        jsi::Runtime &runtime,
        const jsi::Value &shadowNodeWrapper) {
    return Bridging<std::shared_ptr<const ShadowNode>>::fromJs(runtime, shadowNodeWrapper);
}
#endif

Steps to reproduce

  1. npx create-expo-app --template expo-template-blank@54 expo-rngh-new-arch
  2. cd expo-rngh-new-arch
  3. npm install react-native-gesture-handler@2.25.0 react-native-reanimated@4.1.2
  4. Enable new architecture
    • app.json → "expo": { "newArchEnabled": true, "ios": { "newArchEnabled": true } }
    • eas.json → "env": { "RCT_NEW_ARCH_ENABLED": "1", "EXPO_NEW_ARCH_ENABLED": "1" }
  5. eas build --platform ios --profile production

Expected Result

Build succeeds with RNGestureHandler + Fabric under the New Architecture.

Actual Result

Build fails at “Install pods” / “Run fastlane” with the compiler errors listed above.

Workaround

Adding both a fallback for REACT_NATIVE_MINOR_VERSION and a local shadowNodeFromValue helper fixes the build. The minimal change we use today:

// [cpp-adapter.cpp](http://_vscodecontentref_/0)  (same idea in iOS functions.mm)

#ifndef REACT_NATIVE_MINOR_VERSION
#define REACT_NATIVE_MINOR_VERSION 81
#endif

#include <react/renderer/bridging/Bridging.h>

#if REACT_NATIVE_MINOR_VERSION >= 81
static inline std::shared_ptr<const ShadowNode> shadowNodeFromValue(
        jsi::Runtime &runtime,
        const jsi::Value &shadowNodeWrapper) {
    return Bridging<std::shared_ptr<const ShadowNode>>::fromJs(runtime, shadowNodeWrapper);
}
#endif

A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

https://gist.github.com/jj-devs/d204fbd5c3c8807fd2c8febd200cb34d

Gesture Handler version

2.25.0

React Native version

0.81.4

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Using Expo Prebuild or an Expo development build

Architecture

New Architecture (Fabric)

Build type

Release mode

Device

None

Device model

N/A – occurs on Expo EAS build infrastructure

Acknowledgements

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Platform: iOSThis issue is specific to iOSRepro providedA reproduction with a snack or repo is provided

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions