firebase-admin-node icon indicating copy to clipboard operation
firebase-admin-node copied to clipboard

Doesn't provide peer deps when using Yarn v2

Open nicholaschiang opened this issue 3 years ago • 9 comments

[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/[email protected] requested by @firebase/auth-interop-types@npm:0.1.5
➤ YN0002: │ @firebase/auth@npm:0.14.9 [387e6] doesn't provide @firebase/[email protected] requested by @firebase/auth-types@npm:0.10.1
➤ YN0002: │ @firebase/auth@npm:0.14.9 [387e6] doesn't provide @firebase/[email protected] requested by @firebase/auth-types@npm:0.10.1

nicholaschiang avatar Jul 31 '20 16:07 nicholaschiang

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

  "@firebase/[email protected]":
    peerDependencies:
      "@firebase/app-types": "0.x"
  "@firebase/[email protected]":
    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/[email protected] requested by @firebase/database@npm:0.6.9

So, I added that to the packageExtensions as well:

  [email protected]:
    dependencies:
      "@firebase/app-types": "0.x"

And it looks fine now.

nicholaschiang avatar Jul 31 '20 16:07 nicholaschiang

None of the above action items can be addressed in this repo. Is there anything that needs to be done in this codebase?

@Feiyang1 what do you think of the above?

hiranya911 avatar Jul 31 '20 18:07 hiranya911

We can fix every package except for @firebase/database. Fixing it for @firebase/database will bring https://github.com/firebase/firebase-admin-node/issues/614 back.

I'm pondering if we should add @firebase/app(-type) back to @firebase/database's peerDependencies as it also breaks our compatibility with Yarn2 in the JS SDK repo. see https://github.com/firebase/firebase-js-sdk/issues/3707

The downside is admin SDK users will start seeing https://github.com/firebase/firebase-admin-node/issues/614 again. Maybe we should talk about creating a @firebase/database-standalone package again, as the workaround in place seems to start causing compatibility issues with newer tools.

Feiyang1 avatar Nov 25 '20 02:11 Feiyang1

@hiranya911 @Feiyang1 Any update on this yet? I'm still seeing these warnings...

nicholaschiang avatar Mar 30 '21 04:03 nicholaschiang

FYI: https://github.com/firebase/firebase-admin-node/issues/1241 / https://github.com/firebase/firebase-admin-node/pull/1250 were opened recently about upgrading @firebase/database and similar dependencies, which may potentially resolve the issues here when merged?

0xdevalias avatar May 06 '21 11:05 0xdevalias

Seems still not fixed yet. Using pnpm here.

m4rvr avatar Mar 10 '22 16:03 m4rvr

Will this be addressed?

johste93 avatar Dec 17 '22 17:12 johste93

So when I install the latest version of firebase-admin with Yarn2 into a new project, this is the only dependency warning I get:

➤ YN0000: ┌ Resolution step
➤ YN0002: │ @firebase/database@npm:0.13.10 doesn't provide @firebase/app-types (pc007b), requested by @firebase/auth-interop-types
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 2s 679ms

Is anyone seeing additional warnings about additional packages? I just want to make sure I have a full list of the problem packages to fix, and the specific packages the warnings are about seem to have changed since the original 2020 post at the top.

In addition to spot-fixing any problem packages, we're also looking into a more comprehensive solution to prevent issues like this in the future.

Note to self: The warning above can be fixed by removing the peerDependencies in auth-interop-types: https://github.com/firebase/firebase-js-sdk/blob/f2923228a9725b330ad6da21073bb2fdbb263027/packages/auth-interop-types/package.json#L15 I don't think they belong there at all and I suspect they are a copy-paste error way back when the package was created.

hsubox76 avatar Dec 20 '22 19:12 hsubox76

any updates on this?

ermish avatar Oct 31 '23 07:10 ermish