-
Notifications
You must be signed in to change notification settings - Fork 624
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
Yarn workspaces expo amplify, Error: resolveDependencies: Found duplicate dependency key 'undefined' in #857
Comments
I'm having this exact same problem. Wondering if it could be caused by multiple |
If I understood you correctly, do you mean updating metro-config versions for all projects in /packages folder? If so, I am not sure really. I created a test repo, and one package and still have the same issue. |
@adbs1 I think the issue is mismatch dependency versions, with So to find out what dependency that is I created a custom After trying a few things, the error disappeared after I removed some dependencies of multiple packages. |
I used to have 2 versions of metro, but removed the library that required it and still lo luck (after clearing any possible cache from watchman to metro and so on). First: it wasn't an issue until I had to update metro to 0.72 Anyone has any insight on this? I have even tried to fork that library repo and changed it's package.json but not cake. |
We've only seen this with multiple Metro installations (specifically, This is due to a new "dependency key", added in #835. This is required by newer Metro versions, but not supplied by older versions of the
This might hint at the problem. Usually (ie, in a React Native context) Even if you don't have an explicit Running |
The case is closed for me but only after deleting the library that contained a peerDependencies entry for metro-config v0.58 AND any mention of metro in my package.json (I had one, but removing that was not enough) I want to highlight that the metro dependency was in Thanks again @robhogan the info you provided led me to the only possible conclusions: duplicates are not allowed and that's it. I then spent time finding and killing them all (note that On a final note I'd like to share a 1liner npm script I used a lot in fixing this issue. Hope it helps others:
|
I am getting same issue with react-native version 0.70.4 |
#857 (comment) Step 1: Uninstall @react-native-community/cli@7.0.4 |
All my metro versions are in sync, but still getting the same error Below is my package.json "dependencies": { But I'm still getting this error: ` ` |
@Siddharth-Gautam0 I am also facing the same issue. PS: I am using a bare expo app. |
This works for me:
|
To fix metro version, try something like this {
{
"resolutions": {
"metro": "0.76.0",
"metro-resolver": "0.76.0"
}
}
} in |
@Aleksandriukas Hey dude! thank you for this suggestion. You saved a lot of my time. |
Do you want to request a feature or report a bug?
bug
What is the current behaviour?
The app shows red box related to metro
If the current behaviour is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can
yarn install
andyarn test
.I have setup Yarn workspaces mono repo with expo apps in
/apps
folder.I also have amplify in the
/packages
folder.By nature when I do amplify pull it gets an exact copy of what is up in AWS and hence I'll end up package.json with same name throughout the code base. Yarn workspace is not happy with multiple package.json files with the same name field.
I am using the following code (blacklistRE) to ignore unwanted source code to be considered in metro
The code works just fine with
"metro-config": "0.71.3"
but when I upgrade to"metro-config": "0.72.0"
I get the error as attached.The command I am running is:
yarn workspace MyApp expo run:ios
Since there's not much doc around mono repos and metro configs I thought I share my findings and in case that's not a bug will be great if you guys can let me know what needs to be changed for the new version to work.
What is the expected behavior?
No error
Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
OS: MacOs Montery
npm: 8.13.2
yarn: 1.22.19
"metro-config": "0.72.0"
The text was updated successfully, but these errors were encountered: