firebase / firebase/firebase-js-sdk

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

Open
#2,899 0 comments 0 reactions 0 assignees View on GitHub
api: core api: database needs-attention question
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### [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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.