Not sure if this is related to RN or Metro.
I came across this error while trying to use Metro to bundle a single React Native component but then I also found out that a new initialised project has this issue when checking for deps.
$ react-native init bugProject
$ cd bugProject
$ react-native dependencies --entry-file index.js
Loading dependency graph, done.
Unable to resolve module `AccessibilityInfo`
from `.../node_modules/react-native/Libraries/react-native/react-native-implementation.js`:
Module `AccessibilityInfo` does not exist in the Haste module map
It should work
Check above it's extremely simple to reproduce just init a new project and run the command.
React Native Environment Info:
System:
OS: macOS 10.14.3
CPU: (8) x64 Intel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
Memory: 2.76 GB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.15.1 - ~/.nvm/versions/node/v10.15.1/bin/node
Yarn: 1.13.0 - ~/.nvm/versions/node/v10.15.1/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.15.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 25, 26, 27, 28
Build Tools: 23.0.1, 26.0.1, 26.0.2, 27.0.0, 27.0.3, 28.0.3
System Images: android-25 | Google APIs Intel x86 Atom_64, android-27 | Intel x86 Atom_64
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.6 => 0.58.6
I can definitely reproduce this:
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Memory: 93.90 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.0.0 - /usr/local/bin/node
Yarn: 1.13.0 - ~/.yarn/bin/yarn
npm: 6.5.0 - /usr/local/bin/npm
Watchman: 4.5.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 21, 23, 24, 25, 26, 27, 28
Build Tools: 21.1.2, 23.0.1, 24.0.0, 24.0.3, 25.0.0, 25.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.2, 27.0.3, 28.0.3
System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-24 | Intel x86 Atom, android-24 | Intel x86 Atom_64, android-24 | Google APIs Intel x86 Atom_64
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5199772
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.6.3 => 16.6.3
react-native: 0.58.6 => 0.58.6
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
I tried commenting out the problem import in ~/bugProject/node_modules/react-native/Libraries/react-native/react-native-implementation.js, but that resulted in each subsequent import failing.
seem issue here. when i use "metro-visualizer": "0.53.0" , has the same error with RN 0.58.6
Module `AccessibilityInfo` does not exist in the Haste module map
It looks like you are using an older version of React Native. Please update to the latest release, v0.59 and verify if the issue still exists.
The "Resolution: Old Version" label will be removed automatically once you edit your original post with the results of running react-native info on a project using the latest release.
The error is now different, and it feels like it's something happening even before:
$ react-native dependencies --entry-file index.js
error The "from" argument must be of type string. Received type undefined
Should I open a new issue or rename this one?
@mtt87 You fix the "AccessibilityInfo" issue?
No I just tried to reproduce the issue with the latest version of RN0.59 and that's the new error message that I get.
@mtt87 Please check https://github.com/facebook/react-native/issues/23906#issuecomment-472639800. This should fix the issue for you in RN version <= 0.58. Please report the new error message in 0.59 to https://github.com/react-native-community/react-native-cli That is the right place for this 馃檪 Hope that helps!
@kelset This looks like it should be resolved too.
Thank you I鈥檓 gonna close it :)
Thanks all! <3
Most helpful comment
I can definitely reproduce this:
I tried commenting out the problem import in
~/bugProject/node_modules/react-native/Libraries/react-native/react-native-implementation.js, but that resulted in each subsequent import failing.