AngularFire error only when ng serve --prod
问题 I have an Angular 8 app, using npm package Angular Firebase ( https://github.com/angular/angularfire2 ) and when I build the app with the Angular CLI command ng build --prod and deploy to my hosting I get the following Chrome Browser Console error: TypeError: Object(...)(...).auth is not a function If I instead build with the command ng build --prod --optimization=false the error does not occur. Something with Angular CLI ng build option optimization set to true is causing the AngularFire2