Replies: 1 comment 4 replies
-
That's because of Virtual Packages. In short, When you turn |
Beta Was this translation helpful? Give feedback.
-
That's because of Virtual Packages. In short, When you turn |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently investigating an issue using react-query with the react-query-persist-client package.
react-query
is a regular dependency in thereact-query-persist-client
package.json.When I use
yarn why @tanstack/react-query
in my example project, it resolvesreact-query
twice:The issue is that
react-query-persist-client
creates a React context (for the non-react users: sth. like a global variable) provided by the@tanstack/react-query
package. In my application I try to access this context, but it is empty.After some debugging in the browser I found out that
react-query
was bundled twice in my application. The context is created in thereact-query-persist-client
instance ([e51bb] ID above), and when trying to access it from my application directly through thereact-query
package it accesses the [7208f] instance.I cloned the react query repo and changed the dependency
@tanstack/react-query
inside thereact-query-persist-client
package to apeerDependency
and that fixed the issue, now I have only one instance of@tanstack/react-query
.My question is why doesn't yarn pnp access the same instance of
@tanstack/react-query
? They have the same version specified and I don't see any differences. Is there some documentation that explains this behaviour? The manifest just states that plugin creators should usepeerDependencies
, but can also use regular ones.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions