question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

updateCurrentUser failed: First argument "user" must be an instance of Firebase User or null.

See original GitHub issue

Describe your environment

  • Operating System version: Mac
  • Browser version: Google Chrome Version 71.0.3578.98
  • Firebase UI version: "react-firebaseui": "^3.1.2"
  • Firebase SDK version: "firebase": "5.7.1"

Describe the problem

I’m using the https://github.com/firebase/firebaseui-web-react wrapper My implementation it seems to do the login properly on firebase (as i can see the mail logged on “Users” but on my react app I’m getting this error all the time

updateCurrentUser failed: First argument "user" must be an instance of Firebase User or null.  Dismiss

No signInSuccessUrl redirection or signInSuccessWithAuthResult callback works after this error

    signInSuccessUrl: '/',
    callbacks: {
      signInSuccessWithAuthResult: function(authResult, redirectUrl) {
        console.log(authResult)
        console.log(redirectUrl)
        return true
      }
    }

I have no clue about how to debug this or what would be the error

Any ideas?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
WriterDuetcommented, Jan 7, 2019

I hit this error, and the reason was we had two copies of Firebase (one we were including manually, one which npm was pulling in). That caused this bug because for some reason it was using the manual one we specified to invoke the FirebaseUI React component and then calling updateCurrentUser() in the underlying npm version of Firebase (and thus checking the type there). Both versions of Firebase were 5.7.1 so it wasn’t a versioning issue, it was that we had two copies of Firebase and the component wasn’t consistent about which one it used (which I’d argue is a bug in FirebaseUI or the React-FirebaseUI module, but I ain’t dying on that hill).

2reactions
mindhiveficommented, Dec 26, 2018

Same problem here, but this happens to me only when using typescript. I made a test with similar code with javascript with the same environment and same code and it did work.

The actual firebase auth works. A new user is been created to firebase app but then something goes wrong. I have not yet been able to find the exact place where.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase UI: updateCurrentUser failed: First argument "user ...
updateCurrentUser failed : First argument "user" must be an instance of Firebase User or null. How can I restore the auth functionality?
Read more >
First argument "user" must be an instance of Firebase User or ...
updateCurrentUser failed : First argument "user" must be an instance of Firebase User or null.
Read more >
Auth | JavaScript SDK | Firebase JavaScript API reference
Reference for Auth. ... The app associated with the Auth service instance. example ... This function will create a new user account and...
Read more >
UNPKG - @firebase/auth
RECOVER_EMAIL action, which allows a user to undo an email address ... the link is handled in the app directly, this is the...
Read more >
firebase@9.15.0 - jsDocs.io
email and error.credential (firebase.auth.AuthCredential) fields are also provided. You have to link the credential to the existing user with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found