Angularfire: Warnings on optimization bailouts when ng serve

Created on 6 Aug 2020  路  5Comments  路  Source: angular/angularfire

Version info

Angular:
10.0.1

Firebase:
8.6.0

AngularFire:
6.0.2

Other (e.g. Ionic/Cordova, Node, browser, operating system):

How to reproduce these conditions

Whenever I try to ng server, i got the following warnings:

WARNING in /Users/cupidchan/Documents/GitHub/pistevo-health/web/node_modules/@angular/fire/__ivy_ngcc__/fesm2015/angular-fire.js depends on 'firebase/app'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/cupidchan/Documents/GitHub/pistevo-health/web/node_modules/@angular/fire/__ivy_ngcc__/fesm2015/angular-fire-firestore.js depends on '@firebase/app'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/cupidchan/Documents/GitHub/pistevo-health/web/node_modules/@angular/fire/__ivy_ngcc__/fesm2015/angular-fire-firestore.js depends on '@firebase/firestore'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/cupidchan/Documents/GitHub/pistevo-health/web/node_modules/@firebase/firestore/dist/index.cjs.js depends on '@firebase/component'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in /Users/cupidchan/Documents/GitHub/pistevo-health/web/node_modules/@firebase/firestore/dist/index.cjs.js depends on '@firebase/util'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Steps to set up and reproduce

Sample data and security rules

Debug output

* Errors in the JavaScript console *

* Output from firebase.database().enableLogging(true); *

* Screenshots *

Expected behavior


There shouldn't be a warning of optimization bailout

Actual behavior


Warnings show optimization bailout

Most helpful comment

This is fixed in the latest major Firebase release, it will be supported in AF 6.0.4 which will be cut shortly.

in AF 6.0.4: '@angular/fire/firestore'. CommonJS or AMD dependencies can cause optimization bailouts.

All 5 comments

This is fixed in the latest major Firebase release, it will be supported in AF 6.0.4 which will be cut shortly.

This is fixed in the latest major Firebase release, it will be supported in AF 6.0.4 which will be cut shortly.

in AF 6.0.4: '@angular/fire/firestore'. CommonJS or AMD dependencies can cause optimization bailouts.

Not sure why that would be... @angular/fire/firestore like the rest of @angular/fire is compiled by the Angular CLI and most definitely conforms to AFP.

@StephenFluin @mgechev any thoughts? Firebase v8 is modules now, AngularFire is compiled with ng cli and nothing obviously wrong in the package.json. CLI / ngcc is still complaining. 馃し

I'm not seeing these warnings anymore on the latest version of @angular/fire (6.0.4) and Firebase (8.0.1) and Angular (11.0.0-rc.2).

Was this page helpful?
0 / 5 - 0 ratings