react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Reference Error: SHA1 in nx repo and react native

Open quicksilverr opened this issue 3 years ago • 9 comments

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

quicksilverr avatar Nov 06 '22 10:11 quicksilverr

@cortinico Please could you look into this?

quicksilverr avatar Nov 06 '22 10:11 quicksilverr

Facing the same issue. On MacOS it runs fine but on Windows 10, I see the same error

aberikashvili avatar Jan 25 '23 07:01 aberikashvili

I have the same problem, has anyone managed to solve it?

AlexandreMuskus avatar Jan 27 '23 18:01 AlexandreMuskus

Anyone manage to solve it ?

Bauaa9 avatar Jan 28 '23 10:01 Bauaa9

I have the same problem

moonjava2005 avatar Feb 01 '23 13:02 moonjava2005

: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.

github-actions[bot] avatar Feb 09 '23 11:02 github-actions[bot]

Is this specific to nx monorepos? Asking to all the users that +1d this issue

cortinico avatar Feb 09 '23 11:02 cortinico

This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

github-actions[bot] avatar Mar 05 '23 12:03 github-actions[bot]

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.

ianbby avatar Mar 06 '23 17:03 ianbby

This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

github-actions[bot] avatar Mar 31 '23 00:03 github-actions[bot]

This issue was closed because the author hasn't provided the requested feedback after 7 days.

github-actions[bot] avatar Apr 07 '23 00:04 github-actions[bot]

facing the same issue with nx react native project. Any update?

frankA10019 avatar May 09 '23 10:05 frankA10019

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

techgerm avatar Aug 10 '23 04:08 techgerm

Delete the symlinked node_module folder and link it again. Don't forget to reinstall pod.

zahinafsar avatar Aug 25 '23 09:08 zahinafsar

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.

techgerm avatar Aug 25 '23 18:08 techgerm

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

sumagowda avatar Mar 08 '24 04:03 sumagowda