Skip to content
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

Doesn't provide peer deps when using Yarn v2 #973

Open
2 tasks
nicholaschiang opened this issue Jul 31, 2020 · 9 comments
Open
2 tasks

Doesn't provide peer deps when using Yarn v2 #973

nicholaschiang opened this issue Jul 31, 2020 · 9 comments
Assignees

Comments

@nicholaschiang
Copy link

[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
Copy link
Author

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.

@hiranya911
Copy link
Contributor

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?

@Feiyang1
Copy link
Member

Feiyang1 commented Nov 25, 2020

We can fix every package except for @firebase/database. Fixing it for @firebase/database will bring #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 firebase/firebase-js-sdk#3707

The downside is admin SDK users will start seeing #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 Feiyang1 assigned hiranya911 and unassigned Feiyang1 Nov 25, 2020
@nicholaschiang
Copy link
Author

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

@0xdevalias
Copy link

FYI: #1241 / #1250 were opened recently about upgrading @firebase/database and similar dependencies, which may potentially resolve the issues here when merged?

@m4rvr
Copy link

m4rvr commented Mar 10, 2022

Seems still not fixed yet. Using pnpm here.

@johste93
Copy link

Will this be addressed?

@hsubox76
Copy link

hsubox76 commented Dec 20, 2022

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.

@ermish
Copy link

ermish commented Oct 31, 2023

any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants