Skip to content

Fix React-CoreModules missing React-featureflags header path under use_frameworks!#56591

Closed
radko93 wants to merge 1 commit into
react:mainfrom
radko93:fix-react-coremodules-featureflags-header-search-path
Closed

Fix React-CoreModules missing React-featureflags header path under use_frameworks!#56591
radko93 wants to merge 1 commit into
react:mainfrom
radko93:fix-react-coremodules-featureflags-header-search-path

Conversation

@radko93

@radko93 radko93 commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Summary:

React/CoreModules/RCTRedBox.mm imports <react/featureflags/ReactNativeFeatureFlags.h> (added in #56574). Under use_frameworks! this fails to build:

RCTRedBox.mm:19:9: 'react/featureflags/ReactNativeFeatureFlags.h' file not found
Did not find header 'featureflags/ReactNativeFeatureFlags.h' in framework 'react'

React-CoreModules.podspec uses plain s.dependency "React-featureflags", which does not add the framework's Headers dir to HEADER_SEARCH_PATHS. Switching to add_dependency(s, "React-featureflags") preserves the same pod dependency and also adds the dependency header path, matching every neighboring dep (React-debug, React-runtimeexecutor, React-jsinspector*, etc.) in the same file.

On main, this missing podspec-level header path is currently likely masked by the global update_search_paths entry added in #55679, which injects React_featureflags.framework/Headers into inherited header search paths for use_frameworks! builds. 0.83-stable does not have that global entry, so the same podspec issue surfaces as a build regression in 0.83.7.

This change fixes the dependency at the target that directly imports the header, so React-CoreModules no longer relies on a broad inherited header path. A cherry-pick to 0.83-stable would fix the regression in 0.83.7.

Changelog:

[IOS] [FIXED] - Fix React-CoreModules failing to compile with use_frameworks! due to missing React-featureflags header path

Test Plan:

RN 0.83.7 consumer app with use_frameworks! :linkage => :static, RCT_USE_RN_DEP=1: fails before this change. After the fix, pod install regenerates React-CoreModules.debug.xcconfig so HEADER_SEARCH_PATHS includes:

${PODS_CONFIGURATION_BUILD_DIR}/React-featureflags/React_featureflags.framework/Headers

Verified locally that the React-CoreModules pod target builds after the fix:

xcodebuild -project ios/Pods/Pods.xcodeproj \
  -scheme React-CoreModules \
  -configuration Debug \
  -sdk iphonesimulator \
  -derivedDataPath /tmp/rncoremodules-test \
  CODE_SIGNING_ALLOWED=NO build

…dules

RCTRedBox.mm in React-CoreModules imports <react/featureflags/ReactNativeFeatureFlags.h>
(added in react#56574, RedBox 2.0 iOS backport). With use_frameworks!, this file fails
to build with:

  'react/featureflags/ReactNativeFeatureFlags.h' file not found
  (Did not find header 'featureflags/ReactNativeFeatureFlags.h' in framework 'react')

React-CoreModules.podspec declared the React-featureflags dependency using plain
s.dependency, which only registers the pod. The React-Native-specific
add_dependency helper additionally appends the framework's Headers directory
(React_featureflags.framework/Headers) to HEADER_SEARCH_PATHS, which is required
for Clang to resolve <react/featureflags/...> under use_frameworks!.

This aligns React-featureflags with how React-debug, React-runtimeexecutor,
React-jsinspector*, React-utils, React-NativeModulesApple, ReactCommon and
React-RCTFBReactNativeSpec are already declared in the same podspec.

Verified: regenerated React-CoreModules.debug.xcconfig now contains
${PODS_CONFIGURATION_BUILD_DIR}/React-featureflags/React_featureflags.framework/Headers
and the build succeeds.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 24, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Apr 24, 2026
@meta-codesync

meta-codesync Bot commented Apr 24, 2026

Copy link
Copy Markdown

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D102328650.

@meta-codesync meta-codesync Bot closed this in fb0d28c Apr 24, 2026
@meta-codesync

meta-codesync Bot commented Apr 24, 2026

Copy link
Copy Markdown

@cipolleschi merged this pull request in fb0d28c.

@facebook-github-tools facebook-github-tools Bot added the Merged This PR has been merged. label Apr 24, 2026
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @radko93 in fb0d28c

When will my fix make it into a release? | How to file a pick request?

motiz88 pushed a commit to motiz88/react-native that referenced this pull request Apr 28, 2026
…e_frameworks! (react#56591)

Summary:
`React/CoreModules/RCTRedBox.mm` imports `<react/featureflags/ReactNativeFeatureFlags.h>` (added in react#56574). Under `use_frameworks!` this fails to build:

    RCTRedBox.mm:19:9: 'react/featureflags/ReactNativeFeatureFlags.h' file not found
    Did not find header 'featureflags/ReactNativeFeatureFlags.h' in framework 'react'

`React-CoreModules.podspec` uses plain `s.dependency "React-featureflags"`, which does not add the framework's Headers dir to `HEADER_SEARCH_PATHS`. Switching to `add_dependency(s, "React-featureflags")` preserves the same pod dependency and also adds the dependency header path, matching every neighboring dep (`React-debug`, `React-runtimeexecutor`, `React-jsinspector*`, etc.) in the same file.

On `main`, this missing podspec-level header path is currently likely masked by the global `update_search_paths` entry added in react#55679, which injects `React_featureflags.framework/Headers` into inherited header search paths for `use_frameworks!` builds. `0.83-stable` does not have that global entry, so the same podspec issue surfaces as a build regression in 0.83.7.

This change fixes the dependency at the target that directly imports the header, so `React-CoreModules` no longer relies on a broad inherited header path. A cherry-pick to `0.83-stable` would fix the regression in 0.83.7.

## Changelog:

[IOS] [FIXED] - Fix React-CoreModules failing to compile with `use_frameworks!` due to missing React-featureflags header path

Pull Request resolved: react#56591

Test Plan:
RN 0.83.7 consumer app with `use_frameworks! :linkage => :static`, `RCT_USE_RN_DEP=1`: fails before this change. After the fix, `pod install` regenerates `React-CoreModules.debug.xcconfig` so `HEADER_SEARCH_PATHS` includes:

    ${PODS_CONFIGURATION_BUILD_DIR}/React-featureflags/React_featureflags.framework/Headers

Verified locally that the `React-CoreModules` pod target builds after the fix:

    xcodebuild -project ios/Pods/Pods.xcodeproj \
      -scheme React-CoreModules \
      -configuration Debug \
      -sdk iphonesimulator \
      -derivedDataPath /tmp/rncoremodules-test \
      CODE_SIGNING_ALLOWED=NO build

Reviewed By: javache

Differential Revision: D102328650

Pulled By: cipolleschi

fbshipit-source-id: c25a7f5f733637e1d1604929665881b659fd3af3
fabriziocucci added a commit that referenced this pull request May 1, 2026
Summary:
Pull Request resolved: #56640

Cherry-pick of 13 commits from `main` (and 1 from `0.83-stable`) adding the experimental RedBox 2.0 implementation for iOS to `0.85-stable`, plus supporting build fixes.

Changes included:
- Add per-platform `redBoxV2IOS` / `redBoxV2Android` feature flags
- Extract `RCTRedBoxController` from `RCTRedBox.mm` (#56509)
- Add LogBox-styled error overlay (#56550)
- Add shared C++ error parser and ANSI renderer (#56553)
- Show syntax-highlighted code frames (#56551)
- Mark all errors as retryable (#56552)
- Auto-reload on retryable errors (#56549)
- Attempt to clear RedBox by automatically reloading on Metro file change (#56554)
- Fix truncated filenames in call stack frames (#56565)
- Guard tvOS-unavailable APIs in `RCTRedBox2Controller` (#56568)
- Fix C++ syntax in Objective-C header breaking React module build (#56569)
- Add `redbox` subspec to `React-debug` pod (#56584) — from `0.83-stable`, needed for static library builds
- Fix React-CoreModules missing `React-featureflags` header path under `use_frameworks!` (#56591)

All RedBox 2.0 features gated behind the `redBoxV2IOS` feature flag (disabled by default).

Changelog: [Internal]

Test Plan:
- CI
- Feature is behind `redBoxV2IOS` flag, disabled by default

Co-authored-by: Moti Zilberman <moti@meta.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants