I have an Angular 7 site, that works fine without server-side rendering (SSR). I host it using Google's Firebase hosting. I now want to setup SSR. I followed this guide and got it to build and deploy to Firebase Hosting and Functions.
However, the site does not load and the Functions logs include this entry:
ERROR ReferenceError: document is not defined at new CssKeyframesDriver (/user_code/node_modules/@angular/animations/bundles/animations-browser.umd.js:4246:26) at instantiateSupportedAnimationDriver (/user_code/node_modules/@angular/platform-browser/bundles/platform-browser-animations.umd.js:412:88) at _callFactory (/user_code/node_modules/@angular/core/bundles/core.umd.js:19867:24) at _createProviderInstance (/user_code/node_modules/@angular/core/bundles/core.umd.js:19825:30) at resolveNgModuleDep (/user_code/node_modules/@angular/core/bundles/core.umd.js:19786:25) at _createClass (/user_code/node_modules/@angular/core/bundles/core.umd.js:19854:72) at _createProviderInstance (/user_code/node_modules/@angular/core/bundles/core.umd.js:19822:30) at resolveNgModuleDep (/user_code/node_modules/@angular/core/bundles/core.umd.js:19786:25) at _callFactory (/user_code/node_modules/@angular/core/bundles/core.umd.js:19873:71) at _createProviderInstance (/user_code/node_modules/@angular/core/bundles/core.umd.js:19825:30)
Any ideas of what is wrong? I can provide code snippets or individual read access to the repo if requested.