-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug] Accessing a missing peerDependency throws unlisted dependency error #265
Comments
There's a bug in that the message is meant to be clearer than the one you got (PnP can throw semantic errors that detail why a package couldn't be loaded): However, even once this bug is fixed, the (in retrospect the custom error codes might have been a compatibility mistake, but now that things are as they are...) |
It's not just that the message is not clear. This is a missing peer dependency, not an undeclared one. As such, an error with code berry/packages/berry-pnp/sources/loader/makeApi.ts Lines 511 to 540 in 0655aea
I can open a ticket/PR on their repo once it's clear what extra error code the if-check should ignore. |
Yes definitely - the problem is that the reference isn't stored at all when the peer dependency isn't met, rather than being set to I think the fix is just to prepopulate |
Describe the bug
Accessing a missing peer dependency from within a package leads to
rather than the expected "module not found". Note that the package is in fact correctly listed as peer dependency.
This, in turn, leads to issues when packages (correctly) only catch "module not found" errors on optional (peer) dependencies, e.g. in
https://github.com/waysact/webpack-subresource-integrity/blob/ab1f5f9/index.js#L18-L25
To Reproduce
Environment if relevant (please complete the following information):
yarn policies set-version v2
and build of master at 27c1137The text was updated successfully, but these errors were encountered: