Title: Document from Firestore only appears on first render with Angular Universal (SSR) · Issue #3323 · angular/angularfire · GitHub
Open Graph Title: Document from Firestore only appears on first render with Angular Universal (SSR) · Issue #3323 · angular/angularfire
X Title: Document from Firestore only appears on first render with Angular Universal (SSR) · Issue #3323 · angular/angularfire
Description: Version info Angular: 15.2.0 Firebase: 9.8.0 (or whatever AngularFire pulls in...) AngularFire: 7.5.0 Other (e.g. Ionic/Cordova, Node, browser, operating system): Node: 16.19.1 Browser: Chromium 111.0.5563.64 OS: Pop!_OS Linux How to rep...
Open Graph Description: Version info Angular: 15.2.0 Firebase: 9.8.0 (or whatever AngularFire pulls in...) AngularFire: 7.5.0 Other (e.g. Ionic/Cordova, Node, browser, operating system): Node: 16.19.1 Browser: Chromium 11...
X Description: Version info Angular: 15.2.0 Firebase: 9.8.0 (or whatever AngularFire pulls in...) AngularFire: 7.5.0 Other (e.g. Ionic/Cordova, Node, browser, operating system): Node: 16.19.1 Browser: Chromium 11...
Opengraph URL: https://github.com/angular/angularfire/issues/3323
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Document from Firestore only appears on first render with Angular Universal (SSR)","articleBody":"\u003c!--\r\n\r\nIMPORTANT! YOU MUST FOLLOW THESE INSTRUCTIONS OR YOUR ISSUE WILL BE CLOSED.\r\n\r\nThank you for contributing to the Angular and Firebase communities!\r\n\r\nHave a usage question?\r\n=======================\r\nWe get lots of those and we love helping you, but GitHub is not the best place for them and they will be closed. Here are some resources to get help:\r\n\r\n- Go through the Developer's Guide: https://github.com/angular/angularfire2#developer-guide\r\n\r\nIf the official documentation doesn't help, try asking through our officially supported channels:\r\n\r\n- Firebase Google Group: https://groups.google.com/forum/#!forum/firebase-talk\r\n- Stack Overflow: https://stackoverflow.com/questions/tagged/angular (include the firebase and angularfire tags, too!)\r\n\r\n*Please avoid double posting across multiple channels!*\r\n\r\nThink you found a bug?\r\n=======================\r\nYeah, we're definitely not perfect! Please use the bug report template below and include a minimal repro when opening the issue.\r\n\r\nHave a feature request?\r\n========================\r\nGreat, we love hearing how we can improve our products! Remove the template below and\r\nprovide an explanation of your feature request. Provide code samples if applicable. Try to\r\nthink about what it will allow you to do that you can't do today? How will it make current\r\nworkarounds straightforward? What potential bugs and edge cases does it help to avoid?\r\n\r\n-->\r\n\r\n\r\n### Version info\r\n\r\n\u003c!-- What versions of the following libraries are you using? Note that your issue may already\r\nbe fixed in the latest versions. -->\r\n\r\n**Angular:**\r\n15.2.0\r\n\r\n**Firebase:**\r\n9.8.0 (or whatever AngularFire pulls in...)\r\n\r\n**AngularFire:**\r\n7.5.0\r\n\r\n**Other (e.g. Ionic/Cordova, Node, browser, operating system):**\r\nNode: 16.19.1\r\nBrowser: Chromium 111.0.5563.64\r\nOS: Pop!_OS Linux\r\n\r\n### How to reproduce these conditions\r\n\r\n**Failing test unit, Stackblitz demonstrating the problem**\r\n(follow steps below) \r\n\r\n\u003c!-- \r\nProvide a failing test unit, or create a minimal, complete, and \r\nverifiable example (http://stackoverflow.com/help/mcve) using \r\nStackBlitz (https://stackblitz.com/edit/angular-fire-start).\r\n-->\r\n\r\n**Steps to set up and reproduce**\r\n\r\n1. Create a Firestore collection (e.g. 'examples') with a document containing some data.\r\n2. `ng new ssr-test --routing=true --style=scss`\r\n3. `cd ssr-test`\r\n4. `ng generate environments`\r\n5. `ng add @nguniversal/express-engine`\r\n6. `ng add @angular/fire` (hook it up with Firestore from step 1)\r\n7. Replace `app.component.ts` with the following (`path` in `ngOnInit` refers to step 1):\r\n```\r\nimport { Component, OnInit } from '@angular/core';\r\nimport { doc, docData, Firestore } from '@angular/fire/firestore';\r\nimport { Observable } from 'rxjs';\r\n\r\n@Component({\r\n selector: 'app-root',\r\n template: '\u003cpre>{{ data$ | async | json }}\u003c/pre>'\r\n})\r\nexport class AppComponent implements OnInit {\r\n\r\n data$: Observable\u003cany> | null = null;\r\n\r\n constructor(private firestore: Firestore) {\r\n }\r\n\r\n ngOnInit() {\r\n\r\n const path = '/examples/GscrMmeBDasN6llxVybm'\r\n const ref = doc(this.firestore, path);\r\n this.data$ = docData(ref);\r\n }\r\n}\r\n```\r\n8. npm run build:ssr && npm run serve:ssr\r\n9. open http://localhost:4000 and view page source\r\n10. refresh page source\r\n\r\n\u003c!-- detailed instructions to run your minimal repro or to recreate the environment -->\r\n\r\n**Sample data and security rules**\r\nN/A\r\n\r\n\u003c!-- include/attach/link to some json sample data (or provide credentials to a sanitized, test Firebase project) -->\r\n\r\n### Debug output\r\n\r\n** Errors in the JavaScript console **\r\nN/A\r\n\r\n** Output from `firebase.database().enableLogging(true);` **\r\nN/A\r\n\r\n** Screenshots **\r\nN/A\r\n\r\n### Expected behavior\r\n\r\nContent of document from Firestore should appear on first view of source page and on every subsequent refresh.\r\n\r\n### Actual behavior\r\n\r\nContent of document from Firestore appears on first view of source page, then on subsequent refreshes is appears as `null`.\r\n","author":{"url":"https://github.com/estatian","@type":"Person","name":"estatian"},"datePublished":"2023-03-12T10:57:41Z","url":"https://github.com/angular/angularfire/issues/3323"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c8851be2-2cd0-71d9-9cfb-e3a944af8d2c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED50:50BE3:213BFF1:2BEAEA2:6B035A4A |
| html-safe-nonce | 067a074a2709f593acb1cde9f66ecbccee883ba81d4852351d7ea1b05d0b6e0f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDUwOjUwQkUzOjIxM0JGRjE6MkJFQUVBMjo2QjAzNUE0QSIsInZpc2l0b3JfaWQiOiIzNDA5NTg5NjIyNTY3ODE5ODUwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b1aea0c6d5413e0bb4921d584a2970e76fc3c64b2db047903ce5700d631b1acb |
| hovercard-subject-tag | issue:1620319799 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/3323/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7c59baafcc20fd0dbb9f1ac915b310fcffe5348d28e3098918830d37ea0d3821/angular/angularfire/issues/3323 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7c59baafcc20fd0dbb9f1ac915b310fcffe5348d28e3098918830d37ea0d3821/angular/angularfire/issues/3323 |
| og:image:alt | Version info Angular: 15.2.0 Firebase: 9.8.0 (or whatever AngularFire pulls in...) AngularFire: 7.5.0 Other (e.g. Ionic/Cordova, Node, browser, operating system): Node: 16.19.1 Browser: Chromium 11... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | estatian |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angularfire git https://github.com/angular/angularfire.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 49453413 |
| octolytics-dimension-repository_nwo | angular/angularfire |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49453413 |
| octolytics-dimension-repository_network_root_nwo | angular/angularfire |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width