Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

'updateCurrentUser failed: First argument "user" must be an instance of Firebase User or null.' when running in Firebase Hosting

Open
#90 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
firebase, javascript, react

Research direction

Start by reproducing the issue in Firebase Hosting with the reserved /__/firebase/init.js script and the StyledFirebaseAuth component using firebase.auth(). Check how the CDN Firebase instance interacts with the npm-loaded FirebaseUI dependency. Done means establishing and documenting a supported setup that avoids the duplicate-global warning and the updateCurrentUser error.

Written by the indexing model from the issue text.

Description

Hi - I'm not sure if this is a bug report for FirebaseUI-web-react of FirebaseUI-web; I suspect this is the correct place but please tell me if not.

I'm running my app in Firebase Hosting, and I'm linking the magic/reserved URLs that autoconfigure firebase (<script src="/__/firebase/init.js"></script>)

Later, when <StyledFirebaseAuth uiConfig={uiConfig} firebaseAuth={firebase.auth()}/> is mounted, I get this warn on the console:

Warning: Firebase is already defined in the global scope. Please make sure Firebase library is only loaded once.

This warning is there because window.firebase is defined (it was defined from in the init.js loaded from the reserved URL).

I understand this is because I have a "version" of firebase loaded from the CDN and another "version" of firebase loaded from NPM (from a firebaseui dependency).

I would ignore this warning (since I made sure I'm loading the same version of Firebase from the CDN and from npm) but after logging in using GOOGLE_AUTH as provider, I get:

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

and in my experience this is related to the previous warning.

So, my question would be: what's the correct way to use firebaseui-web-react when I'm running in the Firebase Hosting thus using Firebase from the CDN and not NPM.

thanks

Dominant language
JavaScript
Stars
1.3k
Forks
246
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from firebase/firebaseui-web-react

All issues in firebase/firebaseui-web-react

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.