angular / angularfire

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

Warnings on optimization bailouts when ng serve #2565

Closed cupidchan closed 3 years ago

cupidchan commented 3 years ago

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

Splaktar commented 3 years ago

Duplicate of https://github.com/angular/angularfire/issues/2478 and https://github.com/firebase/firebase-js-sdk/issues/3315.

jamesdaniels commented 3 years ago

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

pgg commented 3 years ago

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.

jamesdaniels commented 3 years ago

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. 🤷

StephenFluin commented 3 years ago

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).