Open jjgriff93 opened 10 months ago
For others hitting this issue you can work around it like so:
constructor(
private performance: Performance,
@Inject(PLATFORM_ID) private platformId: Object
) {
this.isBrowser = isPlatformBrowser(this.platformId);
if (this.isBrowser) {
this.startupTrace = trace(this.performance, 'angularStartup');
this.startupTrace.start();
}
}
Version info
Angular: 17.0.8
Firebase: 10.7.1
AngularFire: 17.0.0
Other (e.g. Ionic/Cordova, Node, browser, operating system): Node 18, Ionic 7, MacOS
How to reproduce these conditions
Steps to set up and reproduce
ng add @angular/fire@17
ng add @angular/ssr
ng build
Debug output
Expected behavior
AngularFire should check if rendering on a browser before calling Performance code (which relies on
window
being available)Actual behavior
No check is done, so when calling the Performance library, this above error occurs as soon as pre-rendering on the server happens and
window
is accessed but isn't available due to not running in a browser