Skip to content

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

Open
@jahed

Description

@jahed

[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/[email protected] 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions