docs: add App Hosting SSR deployment guide#3720
Conversation
Adds docs/app-hosting.md documenting the silent SSR-to-CSR fallback that trips up Angular apps deployed to Firebase App Hosting: how to detect it with the ng-server-context marker, and the two-step fix (update @angular/core and @angular/ssr, then set trustProxyHeaders: true on AngularNodeAppEngine). It applies to both public deploy paths, a connected GitHub repo and firebase deploy, which build the same way, and defers to Firebase's App Hosting troubleshooting guide as the authoritative source. Links the guide from the README Resources section.
Links Firebase's own deploy guides for the two public paths (connect a GitHub repo, or firebase deploy from a local machine) instead of re-documenting the steps, so the guide's title is honest and the reader reaches the deploy instructions before the Angular-specific gotcha.
| Pick an SSR route (not an SSG/prerendered one) and fetch it: | ||
|
|
||
| ```bash | ||
| curl -s https://YOUR-SITE/ | grep ng-server-context |
There was a problem hiding this comment.
The command here is for Cloud Functions logs, not App Hosting. App Hosting runs as a separate product and its server logs go to Google Cloud Logging, not the Functions log stream. A reader who runs firebase functions:log on an App Hosting deployment will get no output and likely conclude there is nothing to see. Suggest replacing this with a pointer to the Cloud Console (Logging > Log Explorer, filter by the App Hosting backend resource) or noting that gcloud logging read is the CLI path.
There was a problem hiding this comment.
Good catch, thanks. Fixed in 8f7c13e: the guide now points at the backend's Logs tab (Runtime logs) in the Firebase console, plus a gcloud logging read command as the CLI option, and links Firebase's View logs and metrics guide. I verified both live against a real App Hosting backend before pushing.
tyler-reitz
left a comment
There was a problem hiding this comment.
Good addition. One comment on the firebase functions:log reference in the debugging section; App Hosting logs go to Cloud Logging, not the Functions log stream, so that command won't surface anything for App Hosting deployments. Otherwise the guide is clear and the 30-second curl check is exactly the kind of concrete step that helps people unstick themselves.
firebase functions:log reads Cloud Functions logs; App Hosting runs on Cloud Run, so that command surfaces nothing for an App Hosting deployment. Points instead at the backend's Logs tab (Runtime logs) in the Firebase console and a gcloud logging read command, both verified live against a real App Hosting backend, plus a link to Firebase's logging guide.
Logging reference corrected. Thanks for catching that, Tyler. |
Fixes #3719
Description
Adds
docs/app-hosting.md, a deployment guide for server-rendered Angular apps on Firebase App Hosting.It covers the silent SSR-to-CSR fallback that trips up new deployments: how to detect it in 30 seconds with the
ng-server-contextmarker, and the two-step fix (update@angular/core/@angular/ssr, then settrustProxyHeaders: trueonAngularNodeAppEngine).It applies to both public deploy paths (connected GitHub repo and
firebase deploy) and defers to Firebase's App Hosting troubleshooting guide as the authoritative source.It also adds a link under the README's Resources section.
Docs only, no code change.