Skip to content

fix(core): drop the unused optional @angular/platform-server peer - #3792

Open
armando-navarro wants to merge 1 commit into
angular:mainfrom
armando-navarro:a67-drop-platform-server-peer
Open

armando-navarro wants to merge 1 commit into
angular:mainfrom
armando-navarro:a67-drop-platform-server-peer

Conversation

@armando-navarro

Copy link
Copy Markdown
Collaborator

Refs #3667

Removes the optional @angular/platform-server peer 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

  • npm 10 resolves a missing optional peer while it plans an install, instead of skipping it. It picks the newest @angular/platform-server matching AngularFire's range, which is 21.2.25 today.
  • Every @angular/platform-server release requires its own exact @angular/core version, so 21.2.25 asks for @angular/core 21.2.25.
  • In an app whose package.json says ^21.2.0 and which has 21.2.24 installed, @angular/common and the other Angular packages require @angular/core 21.2.24 exactly, so npm stops with Conflicting peer dependency: @angular/core@21.2.25.
  • An app on the newest patch, or one that already installs @angular/platform-server, is not affected.
  • npm changed this in fix(arborist): don't fetch packuments for uninstallable optional peer deps npm/cli#9877, released in npm 12.1.0, and in its backport fix(arborist): don't fetch packuments for uninstallable optional peer deps npm/cli#9903, released in 11.20.0. The npm each current Node line bundles is still affected: 10.8.2 (Node 20), 10.9.9 (Node 22), 11.19.0 (Node 24) and 11.19.1 (Node 26).

Changes

  • src/package.json: drops @angular/platform-server from peerDependencies and peerDependenciesMeta. The root package.json keeps it as a dev dependency for the test runner.

Behavior to know

  • 21.0.0-rc.1 and 20.1.0 still declare this peer, so the fix reaches @next and @latest installs only with the next release on each line. A cherry-pick to 20.1.x follows this PR.
  • npm no longer warns when an app pairs AngularFire with a @angular/platform-server from another major. That pairing still fails, because @angular/platform-server requires the app's exact @angular/core.

Verification

  • In a copy of an Angular 21.2.24 app with ^21.2.0 ranges, npm install --package-lock-only of the current canary fails with Conflicting peer dependency: @angular/core@21.2.25 on 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.
  • The same install of the package built from this branch succeeds on npm 10.8.2, 10.9.8, 10.9.9 and 11.19.1, with @angular/core left at 21.2.24.
  • @angular/fire@20.1.0 fails the same way on an Angular 20.3.32 app on npm 10.9.9, and installs once the peer is removed.
  • An app that already installs @angular/platform-server 21.2.24 installs before and after this change.
  • No file in 21.0.0-rc.1, 20.1.0 or the package built from this branch imports @angular/platform-server. Only a docs page mentions it.

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.
@armando-navarro armando-navarro added backport: 20.1.x Cherry-pick onto the 20.1.x branch for a 20.1 patch release bump: patch Size of the change: a fix or docs change that reaches users comp: core FirebaseApp DI core (src/app). dependencies Pull requests that update a dependency file type: bug Defect: expected behavior doesn't happen. labels Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport: 20.1.x Cherry-pick onto the 20.1.x branch for a 20.1 patch release bump: patch Size of the change: a fix or docs change that reaches users comp: core FirebaseApp DI core (src/app). dependencies Pull requests that update a dependency file type: bug Defect: expected behavior doesn't happen.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant