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/[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:
- Install firebase-admin-node (latest 8.10.0) and firebase-js-sdk (latest 7.14.0) in the same project
- Inspect node_modules, notice multiple versions of firebase/database, one nested in either of the packages (depending on install order).
- Try using type definitions and they will conflict as they are using different versions of @firebase/database-types.
Relevant Code:
No code involved.