Skip to content
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

Peer dependency chain break when using yarn PnP #2014

Closed
MauriceNino opened this issue May 24, 2022 · 8 comments
Closed

Peer dependency chain break when using yarn PnP #2014

MauriceNino opened this issue May 24, 2022 · 8 comments
Labels

Comments

@MauriceNino
Copy link

MauriceNino commented May 24, 2022

Describe/explain the bug
When using nivo with yarn PnP, it detects a peer dependency error in multiple nivo packages.

Module not found: Error: @react-spring/web tried to access react-dom (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
Required package: react-dom
Required by: @react-spring/web@virtual:e8c6662d9f78e41ff789a28882111350ff5b64c3c794140fe7d01b34d06873f67095ca85dab6b6c9721116a1d2f2c5c8c4eb217f2440fbde8a3b5f9ef602ee80#npm:9.3.1 (via /drone/src/.yarn/__virtual__/@react-spring-web-virtual-3d46070674/0/cache/@react-spring-web-npm-9.3.1-60971e196c-223ce3f849.zip/node_modules/@react-spring/web/dist/)

Ancestor breaking the chain: @nivo/annotations@virtual:35d44cfec8561a797578e823be1fd096acd3df9fc3a4e4b4c80f073c7526baf09ab7c08aeabd68e0c5bb844a46dd175777dcf65c56ed77892b901003e8958493#npm:0.79.1
Ancestor breaking the chain: @nivo/arcs@virtual:5193e94f9222e16f5b856787ff397f36674e24498feb1122bfefc7f678d0294512c05edbb989dd133701c225c88477fbe74421f02e0a28522619076847d07ede#npm:0.79.1
Ancestor breaking the chain: @nivo/axes@virtual:35d44cfec8561a797578e823be1fd096acd3df9fc3a4e4b4c80f073c7526baf09ab7c08aeabd68e0c5bb844a46dd175777dcf65c56ed77892b901003e8958493#npm:0.79.0
Ancestor breaking the chain: @nivo/core@virtual:39a864ede30edfae2e2ba7d0802407e9c2507af99f488a2b4ab24b831e07f4dfc8d9b9c2bc8344d0e497fe2781e197d33ae2bf11687188b4b418654d3b798461#npm:0.79.0
Ancestor breaking the chain: @nivo/line@virtual:39a864ede30edfae2e2ba7d0802407e9c2507af99f488a2b4ab24b831e07f4dfc8d9b9c2bc8344d0e497fe2781e197d33ae2bf11687188b4b418654d3b798461#npm:0.79.1

Full log output can be found here: https://drone.mauz.io/MauriceNino/dashdot/148/1/3

To Reproduce
Check out https://github.com/MauriceNino/dashdot, switch to branch feature/yarn_pnp and run yarn && yarn build.

Additional context
react-spring has a peer dependency to react-dom, so you should forward it, or install it.

@hj8902
Copy link

hj8902 commented Jul 4, 2022

Anyone solve this? In my case,react-dom was already installed but it has still occurred... 🥲

@MauriceNino
Copy link
Author

I have switched to recharts which has way better performance, ...but then I ditched PnP afterwards anyways. It's just not ready to be used in semi-big projects.

@davidcalhoun
Copy link
Contributor

davidcalhoun commented Jul 18, 2022

This is a workaround via.yarnrc.yml and works for 0.78.0 (last minor version). You'll need to run yarn again after changing this:

# .yarnrc.yml

packageExtensions:
  "@react-spring/web@*":
    dependencies:
      react-dom: "*"

Unfortunately the latest Nivo 0.79.0 has other Yarn pnp related errors which I haven't been able to workaround - #1941 and #1951, just a heads up.

@evokeego
Copy link

Whoo! Working for me with the 2 workarounds mentioned above (#2014 (comment)) and in #1941 (#1941 (comment))

@stale
Copy link

stale bot commented Nov 25, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

@stale stale bot added the stale label Nov 25, 2022
@MauriceNino
Copy link
Author

bump

@stale
Copy link

stale bot commented Dec 4, 2022

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

@stale stale bot closed this as completed Dec 4, 2022
@plouc
Copy link
Owner

plouc commented Apr 28, 2023

I'm trying to address this issue in #2313.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants