Repository navigation
fix(core): drop the unused optional @angular/platform-server peer - #3792
Open
armando-navarro wants to merge 1 commit into
Open
armando-navarro wants to merge 1 commit into
armando-navarro wants to merge 1 commit into
Conversation
npm 10, and npm 11 before 11.20, resolve a missing optional peer anyway while installing. For an app whose package.json uses caret ranges and whose Angular is one patch behind the newest, npm picks the newest @angular/platform-server, which requires that exact newest @angular/core, and the install stops with ERESOLVE. Every current Node line bundles one of those npm versions. Nothing in the published package imports @angular/platform-server, so the peer is removed. Apps that render on the server still install it themselves, as they already do.
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.
Refs #3667
Removes the optional
@angular/platform-serverpeer from the published package, which no file in the package imports. On npm 10, and on npm 11 before 11.20, that peer alone makes installing AngularFire fail on an app whose Angular is one patch behind the newest.Cause
@angular/platform-servermatching AngularFire's range, which is 21.2.25 today.@angular/platform-serverrelease requires its own exact@angular/coreversion, so 21.2.25 asks for@angular/core21.2.25.package.jsonsays^21.2.0and which has 21.2.24 installed,@angular/commonand the other Angular packages require@angular/core21.2.24 exactly, so npm stops withConflicting peer dependency: @angular/core@21.2.25.@angular/platform-server, is not affected.Changes
src/package.json: drops@angular/platform-serverfrompeerDependenciesandpeerDependenciesMeta. The rootpackage.jsonkeeps it as a dev dependency for the test runner.Behavior to know
21.0.0-rc.1and20.1.0still declare this peer, so the fix reaches@nextand@latestinstalls only with the next release on each line. A cherry-pick to20.1.xfollows this PR.@angular/platform-serverfrom another major. That pairing still fails, because@angular/platform-serverrequires the app's exact@angular/core.Verification
^21.2.0ranges,npm install --package-lock-onlyof the current canary fails withConflicting peer dependency: @angular/core@21.2.25on npm 10.8.2, 10.9.8, 10.9.9, 11.0.0, 11.19.0, 11.19.1 and 12.0.2, and installs on 11.20.0, 11.21.0, 12.1.0 and 12.2.0.@angular/coreleft at 21.2.24.@angular/fire@20.1.0fails the same way on an Angular 20.3.32 app on npm 10.9.9, and installs once the peer is removed.@angular/platform-server21.2.24 installs before and after this change.21.0.0-rc.1,20.1.0or the package built from this branch imports@angular/platform-server. Only a docs page mentions it.