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 upgrade breaks name resolution #5

Open
esetnik opened this issue Feb 25, 2019 · 5 comments
Open

yarn upgrade breaks name resolution #5

esetnik opened this issue Feb 25, 2019 · 5 comments

Comments

@esetnik
Copy link

esetnik commented Feb 25, 2019

See yarnpkg/yarn#7062. Maybe we should add a note to the readme indicating that the user shouldn't run yarn upgrade when using @hot-loader/react-dom with yarn's name resolution.

@theKashey
Copy link
Contributor

Lets first figure out why yarn is doing it.

@Bnaya
Copy link
Member

Bnaya commented Jun 7, 2019

That's yarn feature is very quirky, but it works.
you my lock it better using yarn resolutions
I believe it will get better in yarn 2

@theKashey
Copy link
Contributor

I hope sooner or later required hooks would naturally move to the real react-dom.

@DimitrK
Copy link

DimitrK commented Apr 15, 2020

Hello,
Is there any update on this?

I came across this issue while trying to use @hot-loader/react-dom with Yarn 2 but it breaks complaining with messages like this:

ERROR in ~/.yarn/$$virtual/react-modal-virtual-786af9ff96/0/cache/react-modal-npm-3.6.1-131512d49b-2.zip/node_modules/react-modal/lib/components/Modal.js
Module not found: Error: react-modal tried to access @hot-loader/react-dom, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: @hot-loader/react-dom (via "@hot-loader/react-dom")
Required by: react-modal@virtual:8c9912264b14a583bf71e56248162a803918c4e372c01213a23039a7b527f13db3fcc7e9ceee9f7e7ce6c84d55b3367b1164a40f0c8dd192b60b29392931909d#npm:3.6.1 (via ~/.yarn/$$virtual/react-modal-virtual-786af9ff96/0/cache/react-modal-npm-3.6.1-131512d49b-2.zip/node_modules/react-modal/lib/components/Modal.js)

The way we use @hot-loader/react-dom is by aliasing it as react-dom in webpack config

@theKashey
Copy link
Contributor

The way we use @hot-loader/react-dom is by aliasing it as react-dom in webpack config

I don't have any solution for this case.
Technically #22 should be a good fix this, however we all are (at least I am) waiting for the react-fresh, which would not require all of this.

However, I am wondering how preact is solving this - it's again about aliasing react to other package.

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

4 participants