-
Notifications
You must be signed in to change notification settings - Fork 634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SHA-1 for file ... is not computed
when using resolver.resolveRequest
#330
Comments
I got this when trying to get Expo to work with yarn workspaces, using |
I've got the same issue when I tried to upgrade react-native to 0.57.0. I followed the steps mentioned the change log (https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#057), but had no luck. |
@Stephen2 me too, did you solve it? |
Sorry, moved to different project |
This is still a problem today with "react-native": "^0.59.2". Will there be real fix or do we need to copy/paste the workaround?
|
For anyone seeing this error when using |
I am experiencing this on RN 0.60.5 |
Also fixes RN 0.61 |
Do you mean that on RN 0.61 it is working as expected? |
@dusan-dragon I needed the @vjpr fix to get RN 0.61 to work. |
I'm having this issue on a windows 10 machine here. Same project on another dev machine with the same version of node doesn't display the issue. |
put all files inside assets name of folder something like this ../../assets/beach.jpg |
@donholly I am not sure why no one is flagging this issue more. I have just run in to this issue after I have setup a new terminal and cleaned up all my old node modules. Thanks to @vjpr workaround it worked after rebuilding the app. Is this a miss on our part ? or is this being actively looked into ? |
This worked for me ikbal99 |
Works for me, |
0.61.5 indeed works. |
I solved this issue by using |
I found it was an issue with me accessing the project on a second drive via a symlink on C: rather than navigating to the D: drive |
I fixed it by install correct
|
Thanks @f4th4n it works for me |
I had tried all the methods above but still not work for me. the error log like this
|
i had the same issue and fix it by following this steps |
The solution offered by @vjpr worked like a charm. |
Hello! The patch suggested by @vjpr is working, but it will be better to have an official support of this functionality. |
npm i -g react-native-cli |
In this commit I wanted to use `require` to import the `.github/ISSUE_TEMPLATE` in order to include the file contents. However, despite doing a lot of research and trying my best to figure out the METRO bundler, I cannot seem to get this working as-expected. I keep getting a "SHA-1 for file is not computed" error. According to this thread: facebook/metro#330 One potential solution is to patch metro in order to generate the SHA. However, I don't want to patch metro, that admittedly feels a bit flaky as a solution. In the next commit we'll revert the metro changes and use the GH API to get the bug report file contents instead
In this commit I wanted to use `require` to import the `.github/ISSUE_TEMPLATE` in order to include the file contents. However, despite doing a lot of research and trying my best to figure out the METRO bundler, I cannot seem to get this working as-expected. I keep getting a "SHA-1 for file is not computed" error. According to this thread: facebook/metro#330 One potential solution is to patch metro in order to generate the SHA. However, I don't want to patch metro, that admittedly feels a bit flaky as a solution. In the next commit we'll revert the metro changes and use the GH API to get the bug report file contents instead
I am getting this issue on rn-tester app on android. None of the above is working for me |
Hi there ! My case is probably unlikely: the folder containing the project had I checked the code and there's a specific case for |
If you are using pnpm, see pnpm/pnpm#3731. |
you ar the man |
This worked for me, thanks! |
i am having this issue while generating debug apk! why? |
Just an FYI: was having this issue when running codepush and fixed it by restarting my machine. |
as suggested on facebook#330 (comment)
Just an addition, I ran into this issue today; at first I thought it was due to having pages and routers of my app spread across different libraries using NX, which uses a symlink to However, the issue was that I already had Metro running in another terminal tab, and kept trying to remove TL;DR make sure there are no other Metro processes running when you try anything described in this thread. |
Machine restart fixed my issues too.
It may be that I had a metro process running in the background that got disconnected from my terminal emulator. |
I have the same issue. Running thru |
Started working again after I ran |
RN 0.72.3 I'm using yarn workspaces and the following worked for me:
|
export EAS_LOCAL_BUILD_SKIP_CLEANUP=1 to check logs facebook/metro#330
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I am using a custom
resolver.resolveRequest
function inrn-cli.config.js
. See https://facebook.github.io/metro/docs/en/configuration#resolver-options.The error message is being printed from
metro/src/node-haste/DependencyGraph.js#getSha1
, which is being called bymetro/src/Bundler.js#transformFile
:metro/src/node-haste/DependencyGraph.js#getSha1
The issue is that the file won't exist in the haste map if you are resolving it in the
resolveRequest
hook.If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
.https://github.com/vjpr/expo-v2-test-pnpm/tree/broken
You need to run
pnpm install
(the reason for the custom resolver is because symlinks are not supported by metro and hence cause problems for pnpm).What is the expected behavior?
getSha1
should compute hash if not in haste map.Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
[email protected]
[email protected]
[email protected]
Workaround
Add to metro/src/node-haste/DependencyGraph.js#getSha1:
I have released a patched version here: Use
[email protected]
The text was updated successfully, but these errors were encountered: