Recently, we decided to upgrade one of the devices to macOS 26 Tahoe to see how everything behaves and to determine if it is advisable to upgrade all devices.
While testing our project on the latest Xcode 26.0.1, we encountered the following build-time error: ‘Command PhaseScriptExecution failed with a nonzero exit code’. Below are the logs I see in the Reports tab.
Showing Recent Issues
+ node /Users/admin/Workspace/mobile-app/node_modules/react-native/scripts/bundle.js bundle --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/admin/Library/Developer/Xcode/DerivedData/App-cimwsmjoqfywufalykdelucelmla/Build/Products/Release-iphonesimulator/main.jsbundle --assets-dest /Users/admin/Library/Developer/Xcode/DerivedData/App-cimwsmjoqfywufalykdelucelmla/Build/Products/Release-iphonesimulator/App.app --config-cmd 'node /Users/admin/Workspace/mobile-app/node_modules/react-native/cli.js config'
(node:50950) UnhandledPromiseRejectionWarning: TypeError: pathPattern.replaceAll is not a function
at /Users/admin/Workspace/mobile-app/node_modules/@react-native/metro-config/dist/index.js:38:39
at Array.map (<anonymous>)
at Object.<anonymous> (/Users/admin/Workspace/mobile-app/node_modules/@react-native/metro-config/dist/index.js:38:6)
at Module._compile (internal/modules/cjs/loader.js:1114:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:979:32)
at Function.Module._load (internal/modules/cjs/loader.js:819:12)
at Module.require (internal/modules/cjs/loader.js:1003:19)
at require (internal/modules/cjs/helpers.js:107:18)
at Object.<anonymous> (/Users/admin/Workspace/mobile-app/metro.config.js:1:41)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:50950) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:50950) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
+ [[ false == false ]]
+ cp /Users/admin/Library/Developer/Xcode/DerivedData/App-cimwsmjoqfywufalykdelucelmla/Build/Products/Release-iphonesimulator/main.jsbundle /Users/admin/Library/Developer/Xcode/DerivedData/App-cimwsmjoqfywufalykdelucelmla/Build/Products/Release-iphonesimulator/App.app/
cp: /Users/admin/Library/Developer/Xcode/DerivedData/App-cimwsmjoqfywufalykdelucelmla/Build/Products/Release-iphonesimulator/main.jsbundle: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
I noticed it displays an UnhandledPromiseRejectionWarning saying replaceAll is not a function. My guess is that upgrading the RN version might resolve the issue, but I’d like to know if anyone else has faced the same problem and managed to fix it without upgrading RN.
Here’s my current setup:
"react": "18.3.1",
"react-native": "0.76.5",
and metro-config (devDependency):
"@react-native/metro-config": "0.76.5",
I’ve tried several suggested solutions but had no luck. For reference, I’m using Node v18.20.8. The project builds and runs fine on Xcode 16.4 with macOS Sequoia, but fails on Xcode 26.0.1 with macOS Tahoe.
1 Answer 1
Updated the React Native version to 0.77.1
, and it resolved the issue. I think this is because, starting from 0.77.0
, we need to migrate to Swift files for iOS, or at least add ReactAppDependencyProvider
in the .mm
files if you want to stick with Objective-C++.
One more thing I noticed is that upgrading to 0.77.0
causes some shadow distortion on Android devices, which has been fixed in 0.77.1
. So, it’s better to bump to 0.77.1
.
Comments
Explore related questions
See similar questions with these tags.
"console.log('Node.js version: ', process.version);"
in/Users/admin/Workspace/mobile-app/node_modules/@react-native/metro-config/dist/index.js:38:39
An let me know which node version is used by xcode.