firebase-admin-node
firebase-admin-node copied to clipboard
Doesn't provide peer deps when using Yarn v2
[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:
- Clone this repository by running:
$ git clone https://github.com/tutorbookapp/tutorbook
- Check out to
develop
and fetch the latest changes:
$ git checkout develop && git pull
- Make sure you have Yarn installed and then run:
$ yarn install
- 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
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.
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?
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.
@hiranya911 @Feiyang1 Any update on this yet? I'm still seeing these warnings...
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?
Seems still not fixed yet. Using pnpm here.
Will this be addressed?
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.
any updates on this?