Replies: 5 comments
-
Here's the same issue I posted at |
Beta Was this translation helpful? Give feedback.
-
I need a little more clarity what turbo's role in this issue is. Could you elaborate on what behavior you expect turbo to have and also any turbo commands that lead to this behavior? |
Beta Was this translation helpful? Give feedback.
-
Having had a similar problem with a different package, I don't think is anything to do with Turborepo. You could remove Turborepo completely from the picture and it wouldn't make any difference. |
Beta Was this translation helpful? Give feedback.
-
@chris-olszewski while it looks to me like the issue is being caused by
The entire reason we shifted to a monorepo was being able to share code easier, and so far, we have only been able to share basic presentational react components. Anything involving And in the case of |
Beta Was this translation helpful? Give feedback.
-
@d4mr I agree this is something that's related to Turborepo and verifying all packages are using the same version of a dependency would be a good feature to have. I just wanted to make sure that this was more of a feature request and not a bug in the current behavior of Turborepo. |
Beta Was this translation helpful? Give feedback.
-
What version of Turborepo are you using?
1.5.4
What package manager are you using / does the bug impact?
pnpm
What operating system are you using?
Mac
Describe the Bug
I have a workspace with main app A and a library B. A had
react-query
as a dependency. B hasreact-query
as a peerDependency. For library B to be able to work, the dependency needs to be a singleton.Even though they are using the same exact version, the dependency inside node_modules is being symlinked to two different places:
In App A is being symlinked to:
node_modules/.pnpm/[email protected]_biqbaboplfbrettd7655fr4n2y/node_modules/react-query
In Library B is being symlinked to:
node_modules/.pnpm/[email protected]/node_modules/react-query
I have tried
pnpm up -r
andsyncpack
. I have also tried to set an override for react-query: "^3.39.2".None of this solved my problem.
Additionally, I have tried
rm -rf
ing mynode_modules
and mypnpm-lock.yaml
. Nothing worked.Here are the two different listings for react-query in the pnpm lock file:
The obvious difference seems to be dev with true and false for each of these. No clue why they both exist though. Some help here would be greatly appreciated, since our monorepo breaks if we cannot use the same version for these packages.
Expected Behavior
The dependency should be reused, and the same dependency in both A and B should symlink to the same folder.
To Reproduce
react-query
in your this app.react-query
,react
andreact-dom
as a peer dependency.Checking the symlinks as well as the pnpm-lock file shows that there are multiple installations of the
react-query
dependency.Beta Was this translation helpful? Give feedback.
All reactions