Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

414
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda