fix(core): drop vestigial @angular/platform-browser-dynamic peer#3718
Open
armando-navarro wants to merge 1 commit into
Open
fix(core): drop vestigial @angular/platform-browser-dynamic peer#3718armando-navarro wants to merge 1 commit into
armando-navarro wants to merge 1 commit into
Conversation
Every platform-browser-dynamic 20.x/21.x patch release requires the exact @angular/core and @angular/common version matching its own patch. Declaring pbd as a required peer therefore makes npm pull in a pbd version whose required core/common usually differs from the app's installed core/common, failing `ng add @angular/fire` with ERESOLVE on Angular >= 20.1 apps. Nothing in the published package imports platform-browser-dynamic; the only usage in the repo is the Karma test bootstrap (src/test.ts), which is supplied by the root package.json and is unaffected. Removing a peer nothing imports is non-breaking for consumers. Considered marking the peer optional via peerDependenciesMeta instead (the manifest already uses that pattern for firebase-tools and platform-server); it would also avoid the ERESOLVE on npm, but it keeps advertising a dependency relationship that does not exist and relies on npm-specific resolver behavior. Deletion fixes every package manager. Refs angular#3667
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ng add @angular/firefails withnpm error ERESOLVEon Angular >= 20.1 apps (#3667).Cause
@angular/firedeclares a required peer on@angular/platform-browser-dynamic(^20.0.0on the v20 line,^21.0.0onmain).platform-browser-dynamicpatch release requires the exact@angular/coreand@angular/commonversion matching its own patch (for example,platform-browser-dynamic@20.1.7declares@angular/core@20.1.7).platform-browser-dynamicpatch, and that patch in turn requires the exact@angular/coreand@angular/commonversion matching itself (per point 2). That required version usually differs from thecore/commonthe app already has installed, so npm cannot satisfy both at once and the install aborts withERESOLVE. The reporter's tree pulled inplatform-browser-dynamic@20.1.7, which demandedcore@20.1.7while their app hadcore@20.1.6; a pristine Angular 20 app hits the same conflict through20.0.7.Why removing the peer is safe
platform-browser-dynamic. The unpacked@angular/fire@20.0.1and@21.0.0-rc.0tarballs contain zero references outside the peer declaration itself (checkedfesm2022/*.mjs, all.d.ts, andschematics/).src/test.ts), which is supplied by the repository's rootpackage.jsonand is unaffected.platformBrowserDynamic()get the package from their own dependencies, never from this peer.platform-browser-dynamicas of 20.1; the peer currently forces a deprecated package into every consumer install.Alternative considered: marking the peer optional in
peerDependenciesMeta(the pattern this manifest already uses forfirebase-toolsand@angular/platform-server). That would also avoid theERESOLVEon npm, but it keeps advertising a dependency relationship that does not exist, and the fix would then depend on npm-specific resolver behavior. Removal fixes every package manager. There is precedent for removing unneeded peers outright (#2095).Verification: built the package from this branch and installed the packed tarball into a fresh Angular 21 app: the install succeeds with no
ERESOLVE, andplatform-browser-dynamicis absent from the dependency tree. A control install of the currently published package into the same app pulls in the deprecatedplatform-browser-dynamic@21.2.18.Angular 20 users get this fix through the planned 20.0.2 patch release, which cherry-picks this commit together with the already-merged config generation fix (#3707).
Refs #3667 (left open deliberately: the reporters there are on the v20 line, so the issue will be closed manually once 20.0.2 ships this fix to npm
latest).