Title: Make `firebase` a peer dependency of `@angular/fire` · Issue #3804 · angular/angularfire · GitHub
Open Graph Title: Make `firebase` a peer dependency of `@angular/fire` · Issue #3804 · angular/angularfire
X Title: Make `firebase` a peer dependency of `@angular/fire` · Issue #3804 · angular/angularfire
Description: AngularFire lists firebase under dependencies, so an app that requests a different firebase version than AngularFire does gets a second copy of the SDK nested under node_modules/@angular/fire/node_modules/firebase. The two copies reject ...
Open Graph Description: AngularFire lists firebase under dependencies, so an app that requests a different firebase version than AngularFire does gets a second copy of the SDK nested under node_modules/@angular/fire/node_...
X Description: AngularFire lists firebase under dependencies, so an app that requests a different firebase version than AngularFire does gets a second copy of the SDK nested under node_modules/@angular/fire/node_...
Opengraph URL: https://github.com/angular/angularfire/issues/3804
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Make `firebase` a peer dependency of `@angular/fire`","articleBody":"\nAngularFire lists `firebase` under `dependencies`, so an app that requests a different `firebase` version than AngularFire does gets a second copy of the SDK nested under `node_modules/@angular/fire/node_modules/firebase`. The two copies reject each other's objects at runtime. That is the mechanism behind #3684, #3681 and #3682 on 21.0.0-rc.0, and the same failure is in older reports such as #3245 and #3442.\n\n### Proposal\n\nMake `firebase` a peer dependency in AngularFire 22, so the app owns the single copy of the SDK:\n\n- `firebase ^12.18.0` moves from `dependencies` to `peerDependencies` in the published `package.json`.\n- A `migration-v22` for `ng update` adds `firebase` to the app's `package.json` when it is missing, and aligns an existing entry that is outside the range. `ng update` itself updates a peer the app already declares but never adds one. The migration reuses the alignment `ng add` already runs.\n- The v22 upgrade guide documents the change and the install-time error it produces.\n\n### What would change for apps\n\n- On npm, a `firebase` outside the supported range fails to install with `ERESOLVE`, which says which two versions conflict, instead of installing a second copy that fails at runtime.\n- On pnpm and Yarn, an out-of-range `firebase` installs as one copy with a peer warning. Yarn installs no peer dependencies at all, so an app that never declared `firebase` has to add it, which the migration does.\n- The `ng add` warning for two installed `firebase` versions stays. Under a peer dependency, two copies appear only when another package bundles its own `firebase`.\n\n### History\n\nAngularFire 2.0 made `firebase` a peer dependency for this exact reason (#749, 2016), and 7.3.0 moved it back to `dependencies` (#3159, 2022). Seven of nine comparable wrapper libraries, including rxfire, reactfire and vuefire, list the SDK as a peer.\n\nThis is a breaking change, for 22.0.0.\n\n","author":{"url":"https://github.com/armando-navarro","@type":"Person","name":"armando-navarro"},"datePublished":"2026-10-23T18:34:51Z","url":"https://github.com/angular/angularfire/issues/3804"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8833d415-4162-de37-6915-95fa1537678d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC86:2DC49E:855588:A99A42:6B036043 |
| html-safe-nonce | cdb68c80a4c79c15149ff3c2a5e688fe6b11905414655edab22f7aeae31e5ffd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzg2OjJEQzQ5RTo4NTU1ODg6QTk5QTQyOjZCMDM2MDQzIiwidmlzaXRvcl9pZCI6IjYzNjY2OTYwODQ5OTUyNjg2NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6afc2494c0b5a931a86b597f7a96ebb88bb78a0bb7a54f3e886cbd8db0cc7c55 |
| hovercard-subject-tag | issue:6003433820 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/3804/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2b4fd80e6e718e08acf6a2f187e96c5f294cc9232e250e088c32867c70defd7b/angular/angularfire/issues/3804 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2b4fd80e6e718e08acf6a2f187e96c5f294cc9232e250e088c32867c70defd7b/angular/angularfire/issues/3804 |
| og:image:alt | AngularFire lists firebase under dependencies, so an app that requests a different firebase version than AngularFire does gets a second copy of the SDK nested under node_modules/@angular/fire/node_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | armando-navarro |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angularfire git https://github.com/angular/angularfire.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 49453413 |
| octolytics-dimension-repository_nwo | angular/angularfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49453413 |
| octolytics-dimension-repository_network_root_nwo | angular/angularfire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width