angularfire: app.auth is not a function
Version info
Angular: 6.0.0
Firebase: 5.0.4
AngularFire: 5.0.0-rc.10
Other (e.g. Ionic/Cordova, Node, browser, operating system): WSL, Node 8.11.2, Cordova, etc.
I receive the message:
app.auth is not a function
This occurs in the following code on the line return app.auth()
:
var AngularFireAuth = (function () {
function AngularFireAuth(options, nameOrConfig, platformId, zone) {
var _this = this;
this.zone = zone;
var scheduler = new angularfire2__WEBPACK_IMPORTED_MODULE_3__["FirebaseZoneScheduler"](zone, platformId);
this.auth = zone.runOutsideAngular(function () {
var app = Object(angularfire2__WEBPACK_IMPORTED_MODULE_3__["_firebaseAppFactory"])(options, nameOrConfig);
return app.auth();
});
app
seems to be well-formed:
but it has no auth
property. I am instantiating (or rather, Angular is instantiating) AngularFireAuth
because it is injected into a service, which itself is instantiated quite early in the application life cycle. Was there some change in how soon the app
is completely ready, including its auth
property? Or is this possibly some kind of version conflict?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 6
- Comments: 15 (8 by maintainers)
Had the same issue after upgrading to
angularfire2 5.0.0-rc-11
andfirebase 5.0.4
.Reinstalled node_modules, cleaned node cache, and
app.auth is not a function
keep showing.SOLUTION After pretty much time debugging, did the following and it worked:
$ npm install firebase angularfire2 --save
/src
folder in new project with previous project/src
folder.npm install
$ ng serve
and worked.CLI and package versions: