Breaking change
App Check no longer runs during server rendering by default (#3773). During server rendering, AngularFire no longer calls the function passed to provideAppCheck, and inject(AppCheck) returns null there. Browser-side behavior is unchanged. This fixes the ReferenceError: document is not defined build failure in server-rendered apps, because the reCAPTCHA providers need a browser.
To keep App Check running during server rendering, provide APP_CHECK_ON_SERVER as true in your server config:
import { APP_CHECK_ON_SERVER } from '@angular/fire/app-check';
// in your server app config's providers
{ provide: APP_CHECK_ON_SERVER, useValue: true },Details, including how server-side Firebase requests can still carry an App Check token: App Check during server rendering.
Updating from 21.0.0-rc.1
Installing a release candidate saves its exact version, so it does not move on its own. Run:
ng update @angular/fire@21.0.0-rc.2
What's Changed
Installing and upgrading
- fix: remove the unused optional
@angular/platform-serverpeer dependency, which madenpm installandng add @angular/firefail withERESOLVEon an app one Angular patch behind the newest release. by @armando-navarro in #3792 - fix:
ng update @angular/fireno longer stops before the v21 migration when it runs under Angular CLI 22.3, whose schematics package refuses the file path AngularFire's schematics loaded. by @armando-navarro in #3793 - fix:
ng add @angular/fireno longer stops withInvalid project id: myApp.for a project whose name has capital letters. It andng deployalso no longer crash withCannot read properties of undefined (reading 'email')on firebase-tools 15.26 or later when run without a terminal, for example by an AI agent. by @armando-navarro in #3769 - fix: the
@angular/fire/compat/storagetypings no longer importfirebase/compat, which failed the build withTS2307undermoduleResolution: "bundler". by @armando-navarro in #3796
Server-side rendering
- fix(app-check)!: skip App Check during server rendering by default. See "Breaking change" above. by @armando-navarro in #3773
- fix:
beforeAuthStateChangedfrom@angular/fire/authno longer keeps the app from ever becoming stable for a visitor who never signs in or out. Its callback still runs inside Angular's zone and injection context. by @armando-navarro in #3770
Documentation
- docs: the Quickstart lists npm 11.6 or later as a requirement, since older npm, including the npm 10 that ships with Node.js 20 and 22, cannot install a new Angular 21 project (
Cannot read properties of null (reading 'edgesOut')). by @armando-navarro in #3787 - docs: the upgrade guide covers
ng updatestopping withThe Angular CLI requires a minimum Node.js version of ..., and how to get past it. by @armando-navarro in #3788 - docs: the App Check guide explains what changes during server rendering, how to run App Check there with
APP_CHECK_ON_SERVER, and how to keep App Check out of the server on 21.0.0-rc.1 and earlier. by @armando-navarro in #3775 - docs: the upgrade guide lists the removed
@angular/platform-serverpeer dependency and the App Check change. by @armando-navarro in #3795 - docs: the Quickstart and the upgrade guide install AngularFire 21 with Angular 21, and the product pages point at the Quickstart. by @armando-navarro in #3765
- docs: drop the
--save-exactstep for the release candidate. by @armando-navarro in #3778
Release tooling
- fix(ci): a release now chooses its npm tag when it publishes, so a 20.x release made after 21.0.0 goes to
v20-ltsinstead of replacing 21 onlatest, andnextmoves up to a stable release that passes it. by @armando-navarro in #3794 - fix: canary builds are named one patch above the newest release of their major, for example
21.0.1-canary.<time>.sha-<commit>.ng add @angular/fire@canarynow installs the canary rather than the release candidate, and installing@nextor a release candidate never picks up a canary. by @armando-navarro in #3767 and #3780 - fix: canary builds are ordered by commit time, and the
canarytag can no longer move back to an older build. by @armando-navarro in #3772 and #3784 - chore: the pull request template asks whether a change is breaking. by @armando-navarro in #3782
Full Changelog: 21.0.0-rc.1...21.0.0-rc.2