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

Update webpack peerDependencies for webpack@2.2.1 #408

Closed
tmpfs opened this Issue Mar 6, 2017 · 7 comments

Comments

Projects
None yet
2 participants
@tmpfs
Copy link

tmpfs commented Mar 6, 2017

Webpack Version:
2.2.1

Babel Core Version:
6.22.1

Babel Loader Version:
6.3.2

Please tell us about your environment:
Linux

Current behavior:

Emits a warning on unmet peer dependency upon installation with yarn using webpack@2.2.1.

Expected/desired behavior:

No warning.

It's an easy fix - I can submit a PR if you are interested. Note that webpack@2.2.1 was released a month ago.

I think this would do it:

"webpack": "1 || 2 || ^2.1.0-beta || ^2.2.x"

Maybe even remove support for 2.1.0-beta now?

@danez

This comment has been minimized.

Copy link
Member

danez commented Mar 6, 2017

2 already accounts for all 2.x versions. This is either a problem with yarn or you are using an outdated version of babel-loader

@tmpfs

This comment has been minimized.

Copy link
Author

tmpfs commented Mar 6, 2017

I thought that 2 would cover it also but npm reports the same warning:

UNMET PEER DEPENDENCY webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc

Maybe an issue with the semver parsing module? I am using babel-loader@6.3.2 which I believe is the latest version.

I will try a fresh install to see what happens.

@danez

This comment has been minimized.

Copy link
Member

danez commented Mar 6, 2017

I tried it here and it works correctly.
https://semver.npmjs.com/

You also have webpack as dependency in your project?

@tmpfs

This comment has been minimized.

Copy link
Author

tmpfs commented Mar 6, 2017

Yeh, sorry it's my bad. I have a package within the main project which includes webpack but resolves loaders from node_modules relative to the parent project which means that webpack is not installed in the top-level project. The reason I am resolving loaders at the top-level is that I have found enhanced-resolve very slow with long paths.

I can add webpack to the parent project and declare peerDependencies in the sub-module.

The problem I have is that I would much rather have it (webpack) resolved by the dependency :(

Closing as not an issue.

@tmpfs tmpfs closed this Mar 6, 2017

@danez

This comment has been minimized.

Copy link
Member

danez commented Mar 7, 2017

It might have been this problem in yarn, which is fixed in 0.22

yarnpkg/yarn#2801

@tmpfs

This comment has been minimized.

Copy link
Author

tmpfs commented Mar 7, 2017

@danez - thanks for the heads up. But sadly I think not, I had a structure like this:

project > core-standard > pack-webpack > webpack

But the project was depending upon babel-loader directly:

project > babel-loader

I really wanted the pack-webpack plugin to resolve the webpack dependency directly but have the project resolve loaders (I was configuring resolveLoaders for this to work correctly) due to an issue with enhanced-resolve doing some crazy slow string splitting.

In the end I added webpack to the peerDependencies for the pack-webpack module and got the warning to go away. It is not really what I would have preferred but it solves the problem for the moment.

Thanks for your help & sorry to bother with a non-issue ;)

@tmpfs

This comment has been minimized.

Copy link
Author

tmpfs commented Mar 7, 2017

@danez, ok this is really giving me some headaches now :(

I think the problem comes down to the fact that webpack does not have to be a peer dependency due to the way that resolveLoaders can be configured for webpack.

Would you consider completely removing the peerDependencies entry?

I think people using babel-loader know that they need webpack ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment