Xcode 14.3 - Error: Unable to resolve module ./Libraries/Components/DatePicker/DatePickerIOS
UPDATE: READ HERE FOR LATEST+WORKAROUND ON THIS.
Description
Since upgrading to Xcode 14.3 and working around the other new issues i.e. the codegen ios target version issue, there is still a further issue with metro. Getting a lot of these type of errors. It seems to be every time metro logs a log line from iOS (not Android), it then logs the below message as well (full paths redacted).
This seems to cause a memory leak as well, with the metro node process eventually crashing when > 4GB RAM is used.
The error message is interesting for many reasons.
- Firstly it seems to be trying to resolve a flow type import.
- Secondly the path does exist, but metro is not checking the platform-specific path i.e.
DatePickerIOS.ios.js. - Thirdly we don't even use
DatePickerIOSin the app.
None of these files exist:
* node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx|.native.engine.js|.engine.js)
* node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS/index(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx|.native.engine.js|.engine.js)
15 | import typeof ActivityIndicator from './Libraries/Components/ActivityIndicator/ActivityIndicator';
16 | import typeof Button from './Libraries/Components/Button';
> 17 | import typeof DatePickerIOS from './Libraries/Components/DatePicker/DatePickerIOS';
| ^
18 | import typeof DrawerLayoutAndroid from './Libraries/Components/DrawerAndroid/DrawerLayoutAndroid';
19 | import typeof FlatList from './Libraries/Lists/FlatList';
20 | import typeof Image from './Libraries/Image/Image';
at ModuleResolver.resolveDependency (node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:107:15)
at DependencyGraph.resolveDependency (node_modules/metro/src/node-haste/DependencyGraph.js:288:43)
at Object.resolve (node_modules/metro/src/lib/transformHelpers.js:129:24)
at resolve (node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:33)
at node_modules/metro/src/DeltaBundler/traverseDependencies.js:412:26
at Array.reduce (<anonymous>)
at resolveDependencies (node_modules/metro/src/DeltaBundler/traverseDependencies.js:411:33)
at processModule (node_modules/metro/src/DeltaBundler/traverseDependencies.js:140:31)
at async addDependency (node_modules/metro/src/DeltaBundler/traverseDependencies.js:230:18)
at async Promise.all (index 9)
NOTE that this is not the codegen ios target version issue, I've already worked around that using the patch which has been released as 0.70.8
React Native Version
0.70.6
Output of npx react-native info
System:
OS: macOS 13.3
CPU: (8) arm64 Apple M1 Pro
Memory: 1.78 GB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 16.10.0 - ~/.nvm/versions/node/v16.10.0/bin/node
Yarn: 1.22.19 - ~/redacted/node_modules/.bin/yarn
npm: 8.0.0 - ~/redacted/node_modules/.bin/npm
Watchman: 2023.02.27.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /redacted/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9014738
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
Languages:
Java: 17.0.4.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.67.1 => 0.67.1
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Steps to reproduce
Running a previously working app on Xcode 14.3 / iOS simulator with rosetta
Snack, code example, screenshot, or link to a repository
Can't provide one at this stage
| :warning: | Newer Version of React Native is Available! |
|---|---|
| :information_source: | You are on a supported minor version, but it looks like there's a newer patch available. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
The same issue is happening for me on version 0.71.6 of react-native and version 14.3 of Xcode.
Got the same issue, also version 0.71.6 Xcode 14.3
I'm having the same issue, I'm on version 0.69.9 and XCode 14.3
Started going down that rabbit hole too
Error: Unable to resolve module ./Libraries/Components/DatePicker/DatePickerIOS from `/xxx/node_modules/react-native/index.js:
None of these files exist:
* node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS(.native|.native.js|.js|.native.jsx|.jsx|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx|.native.svg|.svg)
* node_modules/react-native/Libraries/Components/DatePicker/DatePickerIOS/index(.native|.native.js|.js|.native.jsx|.jsx|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx|.native.svg|.svg)
15 | import typeof ActivityIndicator from './Libraries/Components/ActivityIndicator/ActivityIndicator';
16 | import typeof Button from './Libraries/Components/Button';
> 17 | import typeof DatePickerIOS from './Libraries/Components/DatePicker/DatePickerIOS';
| ^
18 | import typeof DrawerLayoutAndroid from './Libraries/Components/DrawerAndroid/DrawerLayoutAndroid';
19 | import typeof FlatList from './Libraries/Lists/FlatList';
20 | import typeof Image from './Libraries/Image/Image';
Xcode v14.3 React Native 0.70.6 Build Target iOS 14.0
Architecture: Apple Silicon (M1 Max)
Had to manually change the iOS Deployment Target of Pods > React-Codegen to iOS 12.4 or otherwise it won't build.
Steps to reproduce:
- Build and run with the aforementioned configuration.
- Navigate around your app.
- Metro eventually produces a memory leak on node (I'm using nvm)

| :warning: | Missing Reproducible Example |
|---|---|
| :information_source: | It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner. |
Same here, I'm on React Native 0.70.5 and XCode 14.3.
This error appears whenever there is any other type of error on the app, and eventually crashes with a memory leak.
Same issue, React native 0.70.5 and XCode 14.3.
same issue
same issue
Fixed with npx react-native upgrade
Same issue
Same issue
I had this issue too. This is a very serious problem. I hope this can be resolved as soon as possible.
expo: 46 -> 48 react native: 0.69.4 -> 0.71.6
Same issue react-native: 0.64.1 xcode: 14.3
Same issue react-native: 0.69.5 xcode: 14.3
Xcode -> Pods -> Build Settings -> Ios Deployment Target change to 12.4 and will work! 🔥
I downgraded xcode version to 14.2 it helped.
- Go to apple developer and download version 14.2
- Set 14.2 version
Enjoy.
Same issue React native : 0.70.8 (release yesterday) Xcode : 14.3
same issue React Native: 0.70.5 Xcode: 14.3
Same issue expo 47.0 react native 0.70.5 xcode 14.3
Same over here.
Xcode 14.3
Same issue here Xcode 14.3
Same issue with Xcode 14.3
Same issue Here with Xcode 14.3
Same issue with Xcode 14.3
Same issue with a multitude of packages.
You can downgrade to Xcode 14.2 to solve this issue:
gem install xcode-install
xcversion install 14.2
xcversion select 14.2
It will install the app Xcode-14.2 that you can use to start your app.
In my case changing the command line tools to 14.2 was not enough and it was critical to launch Xcode-14.2 and not the normal Xcode app that was at version 14.3.
downgrading to Xcode 14.2
Unfortunately, this is not gonna work when you are on Ventura, which requires the latest Xcode version 14.3
any news? I'm having the same issue