Closed
Description
This issue is now fixed, for more details check out this comment.
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
DatePickerIOS
in 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