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 3 PNP not compatible #1809

Open
dylanplural opened this issue Apr 21, 2022 · 0 comments
Open

Yarn 3 PNP not compatible #1809

dylanplural opened this issue Apr 21, 2022 · 0 comments

Comments

@dylanplural
Copy link

If you are reporting a bug or having an issue setting up React Hot Loader, please fill in below. For feature requests, feel free to remove this template entirely.

Description

With yarn2+ (pnp enabled) is used for module resolution. hmr does not work as expected. The documented command
yarn add react-dom@npm:@hot-loader/react-dom
resolves in an error:

yarn add react-dom@npm:@hot-loader/react-dom
➤ YN0001: │ Error: react-dom@npm:@hot-loader/react-dom isn't supported by any available resolver

And the alternative (webpack aliases) results in a runtime error:

Compiled with problems:X

ERROR in ../../.yarn/__virtual__/@szhsin-react-menu-virtual-9328d7bf3c/0/cache/@szhsin-react-menu-npm-3.0.0-c9f0bfbaf8-cfa13060d2.zip/node_modules/@szhsin/react-menu/dist/es/components/ControlledMenu.js 3:0-41

Module not found: Error: Can't resolve 'react-dom' in ...

ERROR in ../../.yarn/__virtual__/@szhsin-react-menu-virtual-9328d7bf3c/0/cache/@szhsin-react-menu-npm-3.0.0-c9f0bfbaf8-cfa13060d2.zip/node_modules/@szhsin/react-menu/dist/es/components/SubMenu.js 3:0-41

Module not found: Error: Can't resolve 'react-dom' in ...

Environment

React Hot Loader version: 17.0.2

Run these commands in the project folder and fill in their results:

  1. node -v: 16.14.2
  2. npm -v: 8.5.0
  3. yarn -v: 3.2.0

Then, specify:

  1. Operating system: Windows 10
  2. Browser and version: chrome latest
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

1 participant