react-native: Error: Unable to resolve module ./Libraries/Components/AccessibilityInfo/AccessibilityInfo
Description
Whenever I’m trying to run my app in my device through xcode I get Error: Unable to resolve module ./Libraries/Components/AccessibilityInfo/AccessibilityInfo from /Users/satyatest2/Work/mobileapp/MobileApp/node_modules/react-native/index.js:
None of these files exist:
- node_modules/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx)
- node_modules/react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo/index(.native|.native.js|.js|.native.json|.json|.native.ts|.ts|.native.tsx|.tsx) 12 | 13 | // Components
14 | import typeof AccessibilityInfo from ‘./Libraries/Components/AccessibilityInfo/AccessibilityInfo’; | ^ 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’; at ModuleResolver.resolveDependency (/Users/satyatest2/Work/mobileapp/MobileApp/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:211:15) at DependencyGraph.resolveDependency (/Users/satyatest2/Work/mobileapp/MobileApp/node_modules/metro/src/node-haste/DependencyGraph.js:413:43) at Object.resolve (/Users/satyatest2/Work/mobileapp/MobileApp/node_modules/metro/src/lib/transformHelpers.js:317:42) at resolve (/Users/satyatest2/Work/mobileapp/MobileApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:629:33) at /Users/satyatest2/Work/mobileapp/MobileApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:645:26 at Array.reduce (<anonymous>) at resolveDependencies (/Users/satyatest2/Work/mobileapp/MobileApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:644:33) at /Users/satyatest2/Work/mobileapp/MobileApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:329:33 at Generator.next (<anonymous>) at asyncGeneratorStep (/Users/satyatest2/Work/mobileapp/MobileApp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:137:24)
I’ve checked the file is already there.
React Native Version
0.64.4
Output of npx react-native info
System: OS: macOS 13.3.1 CPU: (8) x64 Intel® Core™ i5-1038NG7 CPU @ 2.00GHz Memory: 264.35 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 14.8.0 - ~/.nvm/versions/node/v14.8.0/bin/node Yarn: Not Found npm: 6.14.7 - ~/.nvm/versions/node/v14.8.0/bin/npm Watchman: 2022.08.15.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.12.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 14.1/14B47b - /usr/bin/xcodebuild Languages: Java: 11.0.15 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: ^0.64.4 => 0.64.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
I was not able to reproduce in other projects with the same package.json
Snack, code example, screenshot, or link to a repository
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 15
react-native version 0.63.5, facing the same issue:
react-native version 0.63.2, facing the same issue:
The solution is provided in this comment: https://github.com/facebook/react-native/issues/36794#issuecomment-1500880284