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

Yarn PnP webpack react-dom dependency issue #181

Open
1 of 3 tasks
peterhirn opened this issue Oct 21, 2021 · 1 comment
Open
1 of 3 tasks

Yarn PnP webpack react-dom dependency issue #181

peterhirn opened this issue Oct 21, 2021 · 1 comment

Comments

@peterhirn
Copy link

Thanks for opening an issue!

Please select the type of issue you're reporting. For questions.

  • Bug
  • Feature Request
  • Question

Problem Report

Dependency on react-dom broken. Probably related to react-grid-layout/react-draggable#525

yarn install

react-resizable@npm:3.0.4 [65850] doesn't provide react-dom (p951c8), requested by react-draggable

webpack

ERROR in ../../.yarn/__virtual__/react-draggable-virtual-79cbb65d2e/0/cache/react-draggable-npm-4.4.4-f0b7a5c546-b8258a5893.zip/node_modules/react-draggable/build/cjs/DraggableCore.js 14:39-59        
Module not found: Error: react-draggable tried to access react-dom (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.

Workaround

Add to .yarnrc.yml

packageExtensions:
  react-resizable@*:
    peerDependencies:
      react-dom: "*"

Then run yarn install.

@Poolshark
Copy link

Poolshark commented Mar 30, 2022

Same problem here. The workaround did not work for me. Just to be clear, my problem was react-draggable and not react-resizable! Further more, it seems like peerDependencies are not supported with @yarn v3.2.0.

My fix for the

Module not found: Error: react-draggable tried to access react-dom (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.

error is:

packageExtensions:
  "react-draggable@*":
      dependencies:
        "react-dom": "*"

in the yarnrc.yml.

I hope this "hacks" don't become standard when working with Yarn > 1...

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

No branches or pull requests

2 participants