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
@cortinico Please could you look into this?
Facing the same issue. On MacOS it runs fine but on Windows 10, I see the same error
I have the same problem, has anyone managed to solve it?
Anyone manage to solve it ?
I have the same problem
| :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. |
Is this specific to nx monorepos? Asking to all the users that +1d this issue
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.
I know this issue is stale, but, just in case this helps folk out -- one thing to avoid is storing code in macOS semi-protected folders like ~/Desktop, ~/Documents, or ~/Downloads. I have seen that lead to odd errors where processes can be denied during read attempts. If you move your code to e.g. ~/Developer that may help with unexpected read/compute errors like this.
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.
This issue was closed because the author hasn't provided the requested feedback after 7 days.
facing the same issue with nx react native project. Any update?
same issue here, would mean a ton if someone found a solution a could post it here 🙏
Delete the symlinked node_module folder and link it again. Don't forget to reinstall pod.
Delete the symlinked node_module folder and link it again. Don't forget to reinstall pod.
That didn't work for me. For some reason, my issue was related to react-native-track-player: 4.0.0-rc6.
The strangest thing is if I downgraded to react-native-track-player: 4.0.0-rc5, the issue went away.
Still unsure why that's the case but that's my current workaround.
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