question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't provide peer deps when using Yarn v2

See original GitHub issue

[REQUIRED] Describe your environment

  • Operating System version: Ubuntu 18.04.2 (64-bit)
  • Browser version: Firefox 78.0.1 (64-bit)
  • Firebase SDK version: 7.17.1
  • Firebase Product: database and auth

[REQUIRED] Describe the problem

This doesn’t support Yarn v2 because some of the @firebase packages don’t provide their dependent’s peer dependencies (e.g. @firebase/auth doesn’t provide @firebase/util which is requested by @firebase/auth-types).

You should:

  • Add the @firebase/app-types as a peer dependency to @firebase/database and @firebase/auth
  • Add the @firebase/util as a peer dependency to @firebase/auth

Steps to reproduce:

  1. Clone this repository by running:
$ git clone https://github.com/tutorbookapp/tutorbook
  1. Check out to develop and fetch the latest changes:
$ git checkout develop && git pull
  1. Make sure you have Yarn installed and then run:
$ yarn install
  1. Notice that there are warnings about @firebase/database and @firebase/auth not providing their dependency’s peer dependencies:
➤ YN0002: │ @firebase/database@npm:0.6.9 doesn't provide @firebase/app-types@0.x requested by @firebase/auth-interop-types@npm:0.1.5
➤ YN0002: │ @firebase/auth@npm:0.14.9 [387e6] doesn't provide @firebase/app-types@0.x requested by @firebase/auth-types@npm:0.10.1
➤ YN0002: │ @firebase/auth@npm:0.14.9 [387e6] doesn't provide @firebase/util@0.x requested by @firebase/auth-types@npm:0.10.1

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
m4rvrcommented, Mar 10, 2022

Seems still not fixed yet. Using pnpm here.

2reactions
nicholaschiangcommented, Jul 31, 2020

Temporary fix is to use the packageExtensions config in .yarnrc.yml (see docs):

  "@firebase/database@0.x":
    peerDependencies:
      "@firebase/app-types": "0.x"
  "@firebase/auth@0.x":
    peerDependencies:
      "@firebase/app-types": "0.x"
      "@firebase/util": "0.x"

Once I did that, I got a warning about firebase-admin:

➤ YN0002: │ firebase-admin@npm:9.0.0 doesn't provide @firebase/app-types@0.x requested by @firebase/database@npm:0.6.9

So, I added that to the packageExtensions as well:

  firebase-admin@9.0.x:
    dependencies:
      "@firebase/app-types": "0.x"

And it looks fine now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Doesn't provide peer deps when using Yarn v2 #3529 - GitHub
This doesn't support Yarn v2 because some of the @firebase packages don't provide their dependent's peer dependencies (e.g. @firebase/auth doesn ...
Read more >
Migrating to Yarn 2 and solve peer dependencies
I'm trying to upgrade a project to use Yarn 2 instead of the classic version. I've followed the migration guide here.
Read more >
Types of dependencies | Yarn
Having a peer dependency means that your package needs a dependency that is the same exact dependency as the person installing your package....
Read more >
npm, pnpm, and Yarn | IntelliJ IDEA Documentation - JetBrains
IntelliJ IDEA integrates with the npm, Yarn, Yarn 2, and pnpm, ... you handle your project dependencies in package.json files providing ...
Read more >
Managing dependencies - AWS Documentation
If you prefer, you may use Yarn in place of NPM. However, the CDK does not support Yarn's plug-and-play mode, which is default...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found