-
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
Unmet peer dependencies #1078
Comments
Did you try |
Please upgrade to latest version of webpacker: |
@gauravtiwari Sorry to add to this closed ticket. I'm encountering similar unmet peer dependencies even after having upgraded to latest version of webpacker 3.1.1 (using Repro steps:
warning "@rails/webpacker > postcss-cssnext@3.0.2" has unmet peer dependency "caniuse-lite@^1.0.30000697".
warning "webpack-dev-server > webpack-dev-middleware@1.12.2" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
warning " > webpack-dev-server@2.9.7" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0". resulting package.json: {
"dependencies": {
"@rails/webpacker": "^3.1.1",
"coffeescript": "1.12.7"
},
"devDependencies": {
"webpack-dev-server": "^2.9.7"
}
} I use yarn version 1.3.2. |
@serixscorpio No problem :) Those warnings are harmless (apart from generating noise) but if you are concerned you can use versions of |
So, |
See discussion in rails#1078
I am very new to fancy modern style of JS and webpack in general. I do not understand how to follow those instructions to "use versions of webpack-dev-server per warnings." Can you add an example for those who find themselves here? Thanks! |
I am not sure if this is an issue with the latest RC (version 4). |
This is still an issue with RC 4. Webpacker doesn't seem to add webpack to the package.json, it only adds it to the yarn.lock. I get tons of warning of unmet peer dependencies for webpack. I'm no js expert, but I believe webpack should be added to the dev dependencies of the package.json. A simple |
Adding Have you tried resolving the unmet peer dependencies? Does |
@jakeNiemiec |
@jakeNiemiec While adding webpack to the package.json via |
Did you try: |
Just did a fresh install and I am still having this issue:
yarn install v1.12.3 |
Those warnings are about peer dependecies, so it not a problem. The error To get rid of the warning, just add the lib/version specified in the warning on your
|
@DNA Ensure that you put |
@jakeNiemiec You are right, I wrote the wrong section in the example, I've fixed it :) |
I'm upgrading to webpacker 4 and due to the unmet peer deps
|
@josemigallas make sure you have a version that includes this line: https://github.com/arcanis/ts-pnp/blob/master/package.json#L24 The only other thing I can think of is what I warned @.DNA about above: try putting all of your packages in |
Do I need to install
Did not help 😕 |
If they are added to your project properly, you should be able to see them in |
Earlier several people said things like "Those warnings are about peer dependecies, so it not a problem." Looking up "peer dependencies" in Webpack, it looks like it's supposed to mean if you have the thing it has to meet a certain version spec, but you are... not required to have the thing? But do you have to have the thing after all? I am not a Webpacker/Webpack expert, I'm still quite confused about what's going on. I feel that the promise of Rails/webpacker integration should be to give me something that, immediately after a by-the-book install, does not give me any warnings or errors. I feel that maybe this isssue should be re-opened. |
Say you are making To bring this example home, we ask "Why doesn't 🤔...perhaps not the best example. This is what yarn says:
As a rails dev, you never need to worry about peerDeps apart from ensuring that they are listed in your project's |
In a Rails 5.2 app that was generated with Should they be in your projects dependencies already as generated by Rails? Or if not, should there be some clear instructions somewhere telling you to add them? (If I'm understanding right that you need to "ensure that they are listed in your projects dependencies".) It seems like Rails is setting you up incorrectly here, if you need to ensure the peerDeps are listed in your project's dependencies, but the Rails template doesn't do that for you, and nothing else tells you to. If I'm understanding right what's going on -- because other comments in this ticket said you didn't need to do anything in response to "has unmet peer dependency" warnings. But I think you are disagreeing and saying you do need to do something, you need to ensure the peer dependency is listed in your project's dependencies. (Via... The README currently says:
But Not sure how Rails 6 changes things. |
Lots of great examples here: https://github.com/rails/webpacker/tree/master/docs
This is the key thing: when you make use of
I don't think that would work for every instance of that error. I would just do So:
Rails 6 uses a different version of webpack (4). |
OK, yes. But it seems wrong to me that a fresh untouched I'm not sure if you're not understanding me, or you just disagree and think this is appropriate, that it's fine that the fresh out of the box un-touched generated Rails app has unmet peer dependencies that a developer needs to notice and take action to resolve? You can disagree! (I also think it's a problem that the README links to this issue, which has people saying you can just ignore the "unmet peer dependecies" and don't need to do anything -- and indeed that is what I've been doing in my Rails 5.2 app based on that advice. But if I understand you right you are saying that is bad advice?) |
I agree this would be a good PR candidate. You could add the needed deps somewhere around here: https://github.com/rails/webpacker/blob/master/lib/install/template.rb#L37-L46 |
I too had this issue, with this error message as other have experienced:
Both
🎉 Hope that helps! |
My personal experience on Rails 5.2.3 I had a lot of these warnings related to webpack
I also had the latest version of webpack, 4.34.0 I added this to my package.json and it seemed to get rid of all the warnings:
|
This comment has been minimized.
This comment has been minimized.
@domchristie I can confirm that only that adds the necessary dependency
into the dependencies section of the package.json file. Thank you! |
- Showed when run "yarn install --check-files" and push to heroku. - By run "yarn upgrade webpack@^4.0.0" to add "webpack": "^4.0.0" to package.json. - Followed by run "yarn install --check-files" to update the yarn.lock file. (Source: rails/webpacker#1078)
Is this change going to be made in the template that creates a new rails app? IMO a new app should not have any errors. I also found the recommended solution on this thread, but wasted a lot of time on it. It's a confusing error for someone coming to rails for the first time and webpack especially. I think we want rails to be able to create the cononical I don't know much about the rails implementation of webpacker and how it is different from webpack and if there are any incompatibilities. However, if the recommended solution for those who do know these details is adding this dependency package.json for a new rails app, it seems reasonable to keep this issue open until that has been done. Any agreement? Thank You |
I don't understand why this comment was marked as spam, it represents the frustration that a new rails 6 user could experience because of the errors discussed here. Let's fix this for Rails 6 please. This issue was created before Rails 6 was released! I'm happy to volunteer to make the fix. Please reopen rails/rails#39870 or create a new issue as needed. Thank You |
This fixes the following errors during the asset precompilation step warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0". See rails/webpacker#1078
This fixes the following errors during the asset precompilation step warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0". See rails/webpacker#1078
This fixes the following errors during the asset precompilation step warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0". See rails/webpacker#1078
rails/webpacker#1078 Goal: get rid of warnings about peer dependencies unmet. Closes #146.
Hello,
Every time I run yarn install on my Rails project I'm seeing warning messages like:
My
packages.json
file looks like this:I am using node 8.9.2:
Am I doing something incorrectly?
Thanks!
The text was updated successfully, but these errors were encountered: