-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fresh install complains "webpack-dev-server@3.9.0" has unmet peer dependency "webpack@^4.0.0"." #2371
Comments
Some more context (I'm new to understanding npm dependency resolution, so figuring this out as a go along). In a freshly generated app, you have Meanwhile webpack-dev-server 3.9.0 does not have a direct dependency to And the resolution mechanism apparently doesn't recognize the indirect dependency from I am not sure if this is a bug in how npm resolves peer dependencies maybe it ought to be recognizing the indirect dependency as satisfying the peer dependency? I don't fully have my head around the intents and consequences here. If you manually add But, what if some point in the future there's a new release of So what should be done?
|
There are many issues that discuss this at length, here is a recent one: #2191 (comment) These issues will need to be fixed for |
OK, thanks for feedback and providing references to see more. It's been very hard for me starting from not much experience with yarn/npm/node_modules to figure out what's going on, what who considers a bug or problem, to find the existing discussion on it. This helps, and hopefully will be helpful to others. I am not sure what you mean by "unadvised Having the The hard part for me is figuring out what the right thing to do is. And getting everyone on the same page with that. But if there's consensus those would be right (?) -- they are pretty straightforward PRs -- should I just make em? Or am I missing something about barriers to proceeding with those? |
You know when you see a sign that says "not a step"? This is the equivalent that. In short: Don't depend on this, it is not intended to be used this way.
My advice is the same as when you brought this up 7 months ago in #1078 (comment). We can continue this thread there if you wish. |
OK, the thing is, I don't understand what's going on enough to be sure it is a good idea to add With it as a root dependnecy in But am I wrong, this is not really a problem, it's okay just to add it as a local root dep in It's easy to enough to construct the PR, the hard part is knowing the right thing to do here. As I look more and more into it.. I think more and more that javascript dependency management is pretty hairy and I don't understand it! Which makes me reluctant to just send a PR that I can't myself be confident wont' cause other problems down the line. But if you think that's the right thing to do? Unlike 7 months ago, with most recent version of webpacker, there is only this one warning about unmet peer dependency with a freshly generated app, only for |
There is already a problem coming down the line. Both npm (tink) & yarn (pnp) are moving to a pnp model.
I linked the file that you would need to change in the other thread. It would be useful to discuss this in the context of a PR instead of hypotheticals here. |
OK. Yep, I've been reading about yarn pnp and it's issues here, after you mentioned it, although I'm not familiar with tink. I am pretty sure including something as a peer dependency allows you to require it, at least for yarn pnp. I'm still not sure what's what, but I can try to prepare a PR if that makes it easier to discuss. I may switch webpack to a peer dependency in the PR, for the sake of discussion, as I think that may be the correct answer. (As on the model that webpack is a peer dependency of webpack-dev-server, not an ordinary dependency). |
Quite a few of these should be peer dependencies: #2191 (comment) |
Create a fresh install with Rails 6.0.1, by just doing
rails new myapp
, which will causewebpacker:install
task to be run.Rails 6.0.1, webpacker 4.2.0, webpack-dev-server 3.9.0, webpack 4.41.2, yarn 1.19.1.
In the output of
yarn install
, you can see:Expected
I expect a freshly created project created with
rails new
and/orrake webpacker:install
, which has not been customized at all, should not produce any warnings.Fix?
Am I expected to add a "webpack" dependency to my
package.json
myself, is this warning telling me it should be there? Maybe it should just be adevDependency
since that's whatwebpack-dev-server
is? I am not sure what the right thing to do is, or if it will have any unintended side-effects, which is why the generator should do it for me instead of leaving me with a warning.Should
webpacker:install
templates/generators add awebpack
dependency to package.json to begin with, to go along with thewebpack-dev-server
one added already?The text was updated successfully, but these errors were encountered: