René's URL Explorer Experiment


Title: feat(schematics): warn during ng add when firebase is installed at more than one version by armando-navarro · Pull Request #3760 · angular/angularfire · GitHub

Open Graph Title: feat(schematics): warn during ng add when firebase is installed at more than one version by armando-navarro · Pull Request #3760 · angular/angularfire

X Title: feat(schematics): warn during ng add when firebase is installed at more than one version by armando-navarro · Pull Request #3760 · angular/angularfire

Description: Fixes #3754 Refs #3684 Refs #3681 Refs #3682 What this does ng add @angular/fire now asks the project's own package manager which versions of firebase are installed, and says one of three things: more than one version was found, the check could not be completed, or nothing at all. It runs after the install task and before the feature prompt, so node_modules is on disk to be asked about and the answer appears whatever the user then selects. Why Two copies of the Firebase SDK produce two separate module instances, and objects made by one are rejected by the other. The symptoms name the user's own code, so the cause is not guessable from the error: Expected type '_Query', but it was: a custom _Collection object Type does not match the expected instance #3684, #3681 and #3682 are all this, and all open. In each case the diagnosis came down to one command a maintainer had to tell the reporter to run, npm ls firebase. This runs it for them. What a user sees Real ng add output, from a fresh Angular 21 app with firebase@12.18.0 at the root and firebase@11.10.0 under a local dependency: ✔ Packages installed successfully. ⚠️ Your workspace has more than one version of firebase installed. firebase: 2 distinct versions, reached by 4 dependent packages (according to npm) 12.18.0 via @angular/fire 12.18.0 via @angular/fire > rxfire 12.18.0 via the workspace root 11.10.0 via vendor-lib Two copies of the firebase SDK loaded by one app become two separate module instances, and they reject each other's objects at runtime with errors that name your own code rather than the duplication. Run npm ls firebase --all for the full tree. ? What features would you like to setup? The via lines are the part worth having: they name the dependency that pulled the second copy in, which is the fact a user needs in order to act. On the same app without the duplicate, ng add prints nothing between the install and the prompt. The rule about silence Printing nothing is itself a message: a user who reads nothing concludes the install was inspected and is fine. So every path that cannot reach an answer says so instead of staying quiet. A missing package manager, a lockfile written by a newer version, a manager that exits without printing, a project declaring bun, output in an unrecognized shape: each produces a second kind of warning that names what stopped the check. How it works Detect the manager from what the project declares (packageManager in package.json, cli.packageManager in angular.json), then from its lockfile. Both yarns share yarn.lock, so the lockfile's own first lines decide which (# yarn lockfile v1 for yarn 1.x, a __metadata: block for yarn 2+), with a yarn --version probe as the fallback when no lockfile is readable. Run that manager's own query: npm ls, pnpm -r ls, yarn why, yarn list. Read the four output formats into one shape, one file per manager. Hand the result to setup/duplicateWarning.ts, which is the only place that decides what to say. Commands run through cross-spawn with an argument array and no shell: true. Known limit In a monorepo the question is answered for the whole workspace while ng add was pointed at one project inside it. A project that resolves exactly one version of firebase can therefore be warned about a sibling's version that it does not depend on and cannot load. This is not fixed here. Scoping the answer is per-manager work: npm scopes if the command runs in the project's own directory, pnpm scopes if -r is dropped as well, and neither yarn scopes by directory at all. The message is worded so it is not false in that case (it explains what two copies loaded by one app do, rather than asserting a conflict has happened) and the via lines name which project each version came through. Tests 314 unit specs. Parsing is tested against output captured verbatim from real npm, pnpm, yarn 2+ and yarn 1.x installs, because invented fixtures would test a shape I imagined rather than the one each tool emits. One spec launches npm for real, since starting a package manager is the part captured output cannot cover and the part that fails first on Windows. Separately, and not part of CI: an acceptance list run against 16 real installed projects covering all four managers, workspaces, overrides and resolutions, locally linked packages, yarn 2+ virtual locators, and a yarn 1.x project with yarn 2+ on the PATH. Not included Scoping the answer to one project in a monorepo, described above. Any check outside ng add. This does not run at build time or as a lint rule.

Open Graph Description: Fixes #3754 Refs #3684 Refs #3681 Refs #3682 What this does ng add @angular/fire now asks the project's own package manager which versions of firebase are installed, and says one of three thing...

X Description: Fixes #3754 Refs #3684 Refs #3681 Refs #3682 What this does ng add @angular/fire now asks the project's own package manager which versions of firebase are installed, and says one of three t...

Opengraph URL: https://github.com/angular/angularfire/pull/3760

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9db2738c-2d52-d227-7a31-9d8190d04c84
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id970E:2742B0:947416:BC0513:6B0362D4
html-safe-nonce7a72882787a783ff31ac3df6490d0e0f04d174c69d6f39e6dc1661375f77bca1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzBFOjI3NDJCMDo5NDc0MTY6QkMwNTEzOjZCMDM2MkQ0IiwidmlzaXRvcl9pZCI6IjU5NDk2ODgwMDc4OTU1MDc2NjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd6e0547a50eba2c3a37eed16faf820bb0ed275ea951b76306895a87873e44c7f
hovercard-subject-tagpull_request:4409464426
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/angular/angularfire/pull/3760/files
twitter:imagehttps://avatars.githubusercontent.com/u/13904589?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/13904589?s=400&v=4
og:image:altFixes #3754 Refs #3684 Refs #3681 Refs #3682 What this does ng add @angular/fire now asks the project's own package manager which versions of firebase are installed, and says one of three thing...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/angular/angularfire git https://github.com/angular/angularfire.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id49453413
octolytics-dimension-repository_nwoangular/angularfire
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49453413
octolytics-dimension-repository_network_root_nwoangular/angularfire
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angularfire/pull/3760/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangularfire%2Fpull%2F3760%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangularfire%2Fpull%2F3760%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=angular%2Fangularfire
Reloadhttps://github.com/angular/angularfire/pull/3760/files
Reloadhttps://github.com/angular/angularfire/pull/3760/files
Reloadhttps://github.com/angular/angularfire/pull/3760/files
angularhttps://github.com/angular
angularfirehttps://github.com/angular/angularfire
Codehttps://github.com/angular/angularfire
Issues162 (162)https://github.com/angular/angularfire/issues
Pull requests5 (5)https://github.com/angular/angularfire/pulls
Discussionshttps://github.com/angular/angularfire/discussions
Actionshttps://github.com/angular/angularfire/actions
Projectshttps://github.com/angular/angularfire/projects
Security and qualityhttps://github.com/angular/angularfire/security
Insightshttps://github.com/angular/angularfire/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangularfire%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fangular%2Fangularfire%2Fissues%2Fnew%2Fchoose
armando-navarrohttps://github.com/armando-navarro
angular:mainhttps://github.com/angular/angularfire/tree/main
armando-navarro:a38-duplicate-package-detectorhttps://github.com/armando-navarro/angularfire/tree/a38-duplicate-package-detector
Conversation 2 https://github.com/angular/angularfire/pull/3760
Commits 4 https://github.com/angular/angularfire/pull/3760/commits
Checks 24 https://github.com/angular/angularfire/pull/3760/checks
Files changed https://github.com/angular/angularfire/pull/3760/files
Please reload this pagehttps://github.com/angular/angularfire/pull/3760/files
feat(schematics): warn during ng add when firebase is installed at more than one version https://github.com/angular/angularfire/pull/3760/files#top
Show all changes 4 commits https://github.com/angular/angularfire/pull/3760/files
0459c42 feat(schematics): shared workspace readers, and name the source of a … armando-navarro Sep 1, 2026 https://github.com/angular/angularfire/pull/3760/commits/0459c42abfa3423efad3704f9ccf881a2ae8c5f4
25134f6 feat(schematics): report every installed copy of a package by asking … armando-navarro Sep 1, 2026 https://github.com/angular/angularfire/pull/3760/commits/25134f6c12d1092c6fac0339a03b39e1fc8a4f5f
d5e3049 feat(schematics): warn during ng add when firebase is installed at mo… armando-navarro Sep 1, 2026 https://github.com/angular/angularfire/pull/3760/commits/d5e3049ad1ebd82d921d5bc812051d721aab5e99
2598922 Merge branch 'main' into a38-duplicate-package-detector armando-navarro Sep 2, 2026 https://github.com/angular/angularfire/pull/3760/commits/2598922c2be7fe40df1c4d9b053b4b2c9f4e48b5
Clear filters https://github.com/angular/angularfire/pull/3760/files
Please reload this pagehttps://github.com/angular/angularfire/pull/3760/files
Please reload this pagehttps://github.com/angular/angularfire/pull/3760/files
actions.jasmine.ts https://github.com/angular/angularfire/pull/3760/files#diff-fd8fa896f712c72d1c7d5ea794bc3adce7b7e37508e19576a8a120fadeac5d05
actions.ts https://github.com/angular/angularfire/pull/3760/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
duplicatePackages.jasmine.ts https://github.com/angular/angularfire/pull/3760/files#diff-c271256f063c43af21acfe6866fc48ffc4214f9c02d04eadc9ec22233bdc9ec2
format.ts https://github.com/angular/angularfire/pull/3760/files#diff-f85c8580766ec05b81524c55b2f6ee312204dbae115c77e9a6d1c3729058bda1
index.ts https://github.com/angular/angularfire/pull/3760/files#diff-e2e54c7bdd45ab46294e9af39e3d56d1c9f7326caf25e81fbe8f98ec5ac7440e
npm.ts https://github.com/angular/angularfire/pull/3760/files#diff-cfb7e8f98e90d76e03c25c5dd8701922ba1791f394ab1c232dafa26dadfb13dd
pnpm.ts https://github.com/angular/angularfire/pull/3760/files#diff-be8b7a188060f6e60c15285b6ce0ad7d62bcc52de30809295a5f0cf9ee916ef8
queries.ts https://github.com/angular/angularfire/pull/3760/files#diff-011f4799e82a9a1f43badf7728999e9f32603010f941bdb1ceafcff13c8026e2
shared.ts https://github.com/angular/angularfire/pull/3760/files#diff-67291c94303a71a73f835eeec209bc391fe88fe2d8e2c453d6aad59382ee4ad5
types.ts https://github.com/angular/angularfire/pull/3760/files#diff-8eb83d1929a23f3caedbdc0de8a5a02463c23880e3080e43e6aa7e68c38ce165
yarn.ts https://github.com/angular/angularfire/pull/3760/files#diff-090dd5cb3d0bcb176df909c509a1b423742ff54c225ebe720a1b9fc5217c3838
yarnClassic.ts https://github.com/angular/angularfire/pull/3760/files#diff-37188bad96447c9a43a7f35260806effa10871eb607afb16e2cd7d07f410f554
duplicateWarning.jasmine.ts https://github.com/angular/angularfire/pull/3760/files#diff-a3b9bbc86d704aed75b04bf5e277e0f0a02b581949742b2de0ab25efbb91ca5f
duplicateWarning.ts https://github.com/angular/angularfire/pull/3760/files#diff-85a69433e0e1786bc6a100f5dcc747735cfe7d4386148afcd7d1772e61af6568
index.ts https://github.com/angular/angularfire/pull/3760/files#diff-6da872e703b94229ab5ead42c2d1c568a7ef12207953ef05493c8246b904dea4
workspace.ts https://github.com/angular/angularfire/pull/3760/files#diff-c1e733855f2e144557229b3889f3e3f01cc3ddecf33a65ddf8941d112fd697b0
src/schematics/deploy/actions.jasmine.tshttps://github.com/angular/angularfire/pull/3760/files#diff-fd8fa896f712c72d1c7d5ea794bc3adce7b7e37508e19576a8a120fadeac5d05
View file https://github.com/armando-navarro/angularfire/blob/2598922c2be7fe40df1c4d9b053b4b2c9f4e48b5/src/schematics/deploy/actions.jasmine.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angularfire/pull/3760/{{ revealButtonHref }}
https://github.com/angular/angularfire/pull/3760/files#diff-fd8fa896f712c72d1c7d5ea794bc3adce7b7e37508e19576a8a120fadeac5d05
https://github.com/angular/angularfire/pull/3760/files#diff-fd8fa896f712c72d1c7d5ea794bc3adce7b7e37508e19576a8a120fadeac5d05
src/schematics/deploy/actions.tshttps://github.com/angular/angularfire/pull/3760/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
View file https://github.com/armando-navarro/angularfire/blob/2598922c2be7fe40df1c4d9b053b4b2c9f4e48b5/src/schematics/deploy/actions.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angularfire/pull/3760/{{ revealButtonHref }}
https://github.com/angular/angularfire/pull/3760/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3760/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3760/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3760/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3760/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3760/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
src/schematics/duplicatePackages.jasmine.tshttps://github.com/angular/angularfire/pull/3760/files#diff-c271256f063c43af21acfe6866fc48ffc4214f9c02d04eadc9ec22233bdc9ec2
View file https://github.com/armando-navarro/angularfire/blob/2598922c2be7fe40df1c4d9b053b4b2c9f4e48b5/src/schematics/duplicatePackages.jasmine.ts
Open in desktop https://desktop.github.com
Please reload this pagehttps://github.com/angular/angularfire/pull/3760/files
src/schematics/duplicatePackages/format.tshttps://github.com/angular/angularfire/pull/3760/files#diff-f85c8580766ec05b81524c55b2f6ee312204dbae115c77e9a6d1c3729058bda1
View file https://github.com/armando-navarro/angularfire/blob/2598922c2be7fe40df1c4d9b053b4b2c9f4e48b5/src/schematics/duplicatePackages/format.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angularfire/pull/3760/{{ revealButtonHref }}
src/schematics/duplicatePackages/index.tshttps://github.com/angular/angularfire/pull/3760/files#diff-e2e54c7bdd45ab46294e9af39e3d56d1c9f7326caf25e81fbe8f98ec5ac7440e
View file https://github.com/armando-navarro/angularfire/blob/2598922c2be7fe40df1c4d9b053b4b2c9f4e48b5/src/schematics/duplicatePackages/index.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angularfire/pull/3760/{{ revealButtonHref }}
Please reload this pagehttps://github.com/angular/angularfire/pull/3760/files
Please reload this pagehttps://github.com/angular/angularfire/pull/3760/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.