angular / angularfire

Angular + Firebase = ❤️
https://firebaseopensource.com/projects/angular/angularfire2
MIT License
7.66k stars 2.19k forks source link

Prerendering with remote config does not work #2680

Closed motiejunas closed 3 years ago

motiejunas commented 3 years ago

I have a fresh Angular project together with a basic Angular Universal setup.

My goal is to prerender my app with some values filled in from Firebase Remote Config. However, when running npm run prerender, this.remoteConfig.getString does return undefined and I see some Zone errors.

Is this expected or do I possibly miss something in here?

Angular: v11.0.0 Angular Universal: v11.0.0 Angular Fire: 6.1.0-rc.3

jamesdaniels commented 3 years ago

Remote Config is not supported in Node. I'm considering adding a call to the REST API / admin-sdk in a future release to populate the defaults.

In the meantime use the DEFAULTS DI token to populate default values into AngularFireRemoteConfig, see the usage in the sample app in the project root https://github.com/angular/angularfire/blob/37d1437d553b4e157cde6ac3e9c6ad57a82c2ad3/sample/src/app/app.module.ts#L88