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

@firebase/database version conflict between firebase-admin and firebase-js-sdk #2899

Open
jahed opened this issue Apr 12, 2020 · 0 comments
Open

Comments

@jahed
Copy link

jahed commented Apr 12, 2020

[REQUIRED] Describe your environment

  • Operating System version: Fedora 31
  • Browser version: Firefox 75
  • Firebase SDK version: 7.14.0
  • Firebase Product: database

[REQUIRED] Describe the problem

In a project that uses both firebase-admin and firebase-js-sdk (e.g. using workspaces), the version of shared components like @firebase/database can misalign causing each package to use different versions. This also means type definitions that are used by user code will conflict depending on which type definitions are highest up in node_modules.

firebase-admin relies on @firebase/database@0.5.x whereas firebase-js-sdk relies on 0.6.x.

I would strongly recommend as a fix to bump all @firebase/package modules to 1.x to properly reflect semver and avoid this. 0.x is meant for initial development versions and firebase-js-sdk is meant to be production-ready.

https://semver.org/#spec-item-4

As firebase-admin uses caret ranges, minor changes at 1.x won't trigger duplication while 0.x will.

https://docs.npmjs.com/misc/semver#caret-ranges-123-025-004

Steps to reproduce:

  1. Install firebase-admin-node (latest 8.10.0) and firebase-js-sdk (latest 7.14.0) in the same project
  2. Inspect node_modules, notice multiple versions of firebase/database, one nested in either of the packages (depending on install order).
  3. Try using type definitions and they will conflict as they are using different versions of @firebase/database-types.

Relevant Code:

No code involved.

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

4 participants