-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
Bad @babel/core resolution with Yarn Workspaces hoisting #707
Comments
What are your various |
I require |
By the way, adding a nohoist @babel/core to the |
As long as |
Recreating this myself, I was able to control where
The new structure should look like this:
I believe the An alternative option is to add a dummy |
@vikr01 you are right, the core issue is that Yarn should not hoist packages marked as Thanks everyone! |
@marvinroger Was an issue ever opened for this? I'm seeing this error and don't know what the resolution was. |
yarnpkg/yarn#5705 describes the issue, but it's not fixed yet. |
I'm submitting a bug report
Webpack Version:
4.19.1
Babel Core Version:
7.1.2
Babel Loader Version:
8.0.4
Please tell us about your environment:
Windows 10
Current behavior:
When using Yarn Workspaces, we might have the following file tree:
There are two
@babel/core
installs in different locations, because Yarn detected that two packages required two different versions of the package. In my case (from the point of view of thewebpack-config
package), I need@babel/core (7.1.2)
andbabel-loader (8.0.4)
.Unfortunately, in this case,
babel-loader (8.0.4)
does arequire('@babel/core')
, which resolves relative to its ownnode_modules/
folder, which is@babel/core (7.0.0-beta.42)
.Expected/desired behavior:
I expect
babel-loader (8.0.4)
to require from the context of the package requiringbabel-loader
, I need it to resolve to the local@babel/core (7.1.2)
. Except it does not.I am not sure you can solve the resolution context, but the loader can accept a
babelCore
option, that way, we would be able to feed the loader with the version we want.Yarn Workspace is now stable, and is used a lot in monorepo.
Thanks for your great work! 👍
The text was updated successfully, but these errors were encountered: