react-native: Reference Error: SHA1 in nx repo and react native

Description

I’m facing this issue, after upgrading React native version from 0.66.3 to 0.70.1

error: ReferenceError: SHA-1 for file /Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/react-native/index.js (/Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/react-native/index.js) is not computed. Potential causes: 1) You have symlinks in your project - watchman does not follow symlinks. 2) Check blockList in your metro.config.js and make sure it isn’t excluding the file path. at DependencyGraph.getSha1 (/Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/metro/src/node-haste/DependencyGraph.js:198:13) at Transformer._getSha1 (/Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/metro/src/Bundler.js:26:26) at Transformer.transformFile (/Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/metro/src/DeltaBundler/Transformer.js:118:19) at Bundler.transformFile (/Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/metro/src

Version

0.70.1

Output of npx react-native info

System: OS: macOS 12.3.1 CPU: (8) arm64 Apple M1 Memory: 110.53 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 18.6.0 - /opt/homebrew/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 8.13.2 - /opt/homebrew/bin/npm Watchman: Not Found Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3 Android SDK: API Levels: 23, 28, 29, 30, 31, 33 Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0, 33.0.0 System Images: android-31 | Google APIs ARM 64 v8a, android-31 | Google Play ARM 64 v8a Android NDK: 22.1.7171670 IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7678000 Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild Languages: Java: 1.8.0_292 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: * => 18.2.0 react-native: * => 0.70.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

I’m using the nx repo and have create a react native app in it and I’m facing this error, while running yarn run-android app

Snack, code example, screenshot, or link to a repository

Screenshot 2022-11-06 at 4 09 20 PM

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 19 (1 by maintainers)

Most upvoted comments

Deleting node_modules and then rebuilding the app worked for me.

rm -rf node_modules  
rm package-lock.json  
npm install   
nx start YOUR_APP_NAME

same issue here, would mean a ton if someone found a solution a could post it here 🙏