Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

413
Views
Why should I care if my react project has incorrect/unmet peer dependencies?

Does having incorrect/unmet peer dependencies have any significant impact on my react project. I have read the yarn official documentation and it says:

Peer dependencies are a special type of dependency that would only ever come up if you were publishing your own package.

I am not publishing any package here, just a simple react project with installed dependencies. I don't know why it is the case with my react application but I am getting this warning each time I hit yarn install

[3/4] Linking dependencies...
warning "@react-pdf/renderer > react-reconciler@0.24.0" has incorrect peer dependency "react@^16.0.0".
warning " > @testing-library/user-event@12.8.3" has unmet peer dependency "@testing-library/dom@>=7.21.4".
warning "aws-amplify > @aws-amplify/analytics > @aws-sdk/client-firehose > @aws-sdk/middleware-retry > react-native-get-random-values@1.8.0" has unmet peer dependency "react-native@>=0.56".
warning " > mobx-devtools-mst@0.9.30" has incorrect peer dependency "mobx@^2.2.0 || ^3.0.0 || ^4.0.0 || ^5.0.0".

Should I take it seriously and add the peer dependencies properly, and If I choose not to do so, does this negatively impact my project? Can they be automatically added? and why yarn does not automatically add them at the time of adding a dependency?

devenv: Using yarn v1.22.18 as my package manager with node:16-buster image.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

There can only be a single package "A" installed into node_modules. If you have two packages "B" and "C"

  • "B" needs "A@1.0.0"
  • "C" needs "A@2.0.0"

In this hypothetical situation assume that "A" removed a function that "B" was using in 2.0.0. When you code is running, you will get a bizarre error that function was not found or undefined.

This is the problem that can arise with mismatched peer dependencies. You get bizarre errors or behaviors that when you look at the stacktrace, your code is not actually involved in.

In many situations, you don't use 100% of the code in all packages, and your packages don't use all of the code in their dependency, but when it does come up, it is a serious pain to fix.

about 4 years ago · Juan Pablo Isaza Report

0

Peer Dependencies:-

Let Package X need package Y Version 2.0 to work correctly but you installed package Y Version 1.0 then it will give you a warning you don't need to worry about it if it is just a warning when you upload the source code to the server you will reinstall the packages again on it so packages manager will handle it.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!