Firebase-js-sdk: firebase 6.0,0 Auth: Uncaught TypeError: Cannot read property 'resolve' of undefined

Created on 7 May 2019  路  4Comments  路  Source: firebase/firebase-js-sdk

[REQUIRED] Describe your environment

  • Operating System version: Windows 10
  • Browser version: Version 74.0.3729.131 (Official Build) (64-bit)
  • Firebase SDK version: 6.0.0
  • Firebase Product: auth, rxjs

[REQUIRED] Describe the problem

Exception thrown with authState upon login/logout/re-login:

Uncaught TypeError: Cannot read property 'resolve' of undefined
    at lm.h.tc (auth.esm.js?b7aa:317)
    at lm.d [as onAuthStateChanged] (auth.esm.js?b7aa:340)
    at Login.componentDidMount (Login.js?25f4:53)

both using @firebase/auth @ 0.11.0, fine with @firebase/app 0.3.17 but fail with @firebase/app 0.4.0,

Steps to reproduce:

working on it, cannot reproduce elsewhere...

Relevant Code:

working on it, cannot reproduce elsewhere...

auth

Most helpful comment

It's actually not that. We removed firebase.Promise from the interface, but Auth is still using it. Instead, Auth should use native Promise directly. We will make a patch release to fix it. Thanks a lot for reporting it.

All 4 comments

@henrylearn2rock I cannot reproduce this with firebase 6.0.0. Can you try to do a clean npm install to see if it works? You could remove the node_modules and package-lock.json and run npm install again.

@wti806 I tried what you suggested, I even cleared the yarn cache, but I am still getting the same error

Here is the error message from Firefox:

TypeError: _firebase_app__WEBPACK_IMPORTED_MODULE_0___default.a.Promise is undefined[Learn More] main.bundle.js line 1073 > eval:320:33
tc auth.esm.js:317
d auth.esm.js:340
componentDidMount Login.js:53

I suspect it's caused by "Breaking change: Removed polyfills in the Firebase package." since it is complaining about Promise, which is firebase.promise in the code, is undefined.

https://github.com/firebase/firebase-js-sdk/blob/master/packages/auth/src/auth.js#L1349

It's actually not that. We removed firebase.Promise from the interface, but Auth is still using it. Instead, Auth should use native Promise directly. We will make a patch release to fix it. Thanks a lot for reporting it.

Please upgrade to 6.0.1 for the fix.

Was this page helpful?
0 / 5 - 0 ratings