Skip to content

Fix watchFolders when building MacOS app on CI#356

Merged
kraenhansen merged 5 commits intomainfrom
kh/macos-sanity
Feb 14, 2026
Merged

Fix watchFolders when building MacOS app on CI#356
kraenhansen merged 5 commits intomainfrom
kh/macos-sanity

Conversation

@kraenhansen
Copy link
Collaborator

@kraenhansen kraenhansen commented Feb 12, 2026

This fixes watchFolders when building MacOS app on CI, a new version of rnx-kit started including a watchFolder which disabled the check we did to inject the package root as watch folder.

Merging this PR will:

  • Update the metro config (copied from the iOS app) to use the project root to determine when to inject the package root as watch folder.
  • Start bundling and building the MacOS app in separate steps to get better feedback and an environment closer what we want to ensure stability in.

@kraenhansen kraenhansen self-assigned this Feb 12, 2026
@kraenhansen kraenhansen added Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.) MacOS 💻 Anything related to the Apple MacOS platform or React Native MacOS support labels Feb 12, 2026
@kraenhansen
Copy link
Collaborator Author

@cursor help me understand what is different from this run (failing) vs #352

I suspect the MacOS runner or Xcode got updated.

@kraenhansen
Copy link
Collaborator Author

@cursor help debug this failure on CI.

@cursor
Copy link

cursor bot commented Feb 12, 2026

Summary of CI Debugging Analysis

I've analyzed the failing macOS CI run and taken the following actions:

Key Findings:

  1. Error Location: The failure occurs during the "Bundle React Native code and images" Xcode build phase with an UnableToResolveError from Metro bundler. Unfortunately, the actual module name that couldn't be resolved is not visible in the CI logs - only the error type is shown.

  2. What Changed: Between the successful run (PR Bump versions for MacOS test app to React Native v0.81.5 #352 on Feb 10) and the failing run (PR Fix watchFolders when building MacOS app on CI #356 on Feb 12), only PR Enable source maps across CLIs #354 was merged. That PR changed CLI shebangs from:

    #!/usr/bin/env node
    

    to:

    #!/usr/bin/env -S node --enable-source-maps
    
  3. Environment Comparison: The runner image, macOS version (15.7.3), Xcode version (16.4), and Node.js version (v24.13.0) are identical between the successful and failing runs.

Action Taken:

I reverted the shebang changes from PR #354 to test if that resolves the issue. The changes were:

  • packages/cmake-rn/bin/cmake-rn.js
  • packages/ferric/bin/ferric.js
  • packages/gyp-to-cmake/bin/gyp-to-cmake.js
  • packages/host/bin/react-native-node-api.mjs
  • Removed the associated changeset file

The commit has been pushed and a new CI run is in progress (run #21953383969).

Note:

The shebang change may not be the direct cause since the podspec invokes the CLI directly via node dist/node/cli/run.js, bypassing the shebang. If the CI still fails after this revert, the issue might be:

  • A timing/race condition with the Metro server
  • An issue with the @rnx-kit/metro-config package
  • A module resolution issue specific to the dynamically-generated macOS test app setup

Open in Cursor Open in Web

cursor bot pushed a commit that referenced this pull request Feb 12, 2026
The -S flag in env shebang may be causing issues with Metro bundler
during the macOS build. Reverting to test if this fixes the CI.

See: #356 (comment)

Co-authored-by: Kræn Hansen <mail@kraenhansen.dk>
@kraenhansen kraenhansen reopened this Feb 13, 2026
@kraenhansen kraenhansen changed the title Empty commit to trigger CI Build MacOS app in debug mode on CI Feb 14, 2026
@kraenhansen kraenhansen changed the title Build MacOS app in debug mode on CI Fix watchFolders when building MacOS app on CI Feb 14, 2026
@kraenhansen kraenhansen marked this pull request as ready for review February 14, 2026 19:52
@kraenhansen kraenhansen merged commit 5cd0c51 into main Feb 14, 2026
9 checks passed
@kraenhansen kraenhansen deleted the kh/macos-sanity branch February 14, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.) MacOS 💻 Anything related to the Apple MacOS platform or React Native MacOS support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant