-
-
Notifications
You must be signed in to change notification settings - Fork 184
issue: Peer dependencies not picked up by package managers #762
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
Comments
This issue is related: #747 The underlying problem is that, similar to my issue, As mentioned above, the two possible solutions are to publish the sub-packages independently or add all the peer deps from all sub-packages (including |
Solution for now is to use effect via the Happy to open a PR to add the peer-deps at the top level, if that is something you are interested in! :) |
Hey @arlyon , thanks for flagging this! We're happy to take a look or chat about your PR for adding the peer deps at the top level. |
Heya! We've also run into this issue, especially in the context of a large (pnpm) monorepo, whereby projects might declare different versions of each underlying validation library. By declaring the peers in One addition to @arlyon's suggestion (many thanks for opening this issue 🙇), would be to declare |
Let me see if I can adjust the PR accordingly |
Version Number
5.0.1
Codesandbox/Expo snack
https://codesandbox.io/p/devbox/hkjpmt
Steps to reproduce
Observe
Expected behaviour
For the resolvers to build reliably, the package manager needs to know what the peer deps are so that they may link them properly. Without this information, you can end up with unpredictable build errors where, by pure coincidence, a package (which is not listed in the dependencies such as effect) is not available. I am running into this error but cannot replicate it on codesandbox since the preconditions are dependent on a complicated combination of the layout of your workspace, hoisting, package manager, and indeed the build tool you are using (in my case it is nextjs + turbopack).
Listing peer dependencies only in the package.json files in the sub-folder (effect in this case) does not supply enough information to the package manager to be able to hoist / link reliably. They need to be at the top level.
The only solution is to break this into individually-adressable packages (@hookform/resolver-effect for example) or to list all the peer deps in the top level package.
What browsers are you seeing the problem on?
No response
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: