Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#90 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
firebase, javascript, react

Direzione di ricerca

Inizia riproducendo il problema in Firebase Hosting con lo script riservato /__/firebase/init.js e il componente StyledFirebaseAuth usando firebase.auth(). Verifica come l’istanza Firebase del CDN interagisce con la dipendenza FirebaseUI caricata tramite npm. Il lavoro è completato quando è stata definita e documentata una configurazione supportata che eviti sia l’avviso duplicate-global sia l’errore updateCurrentUser.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
JavaScript
Stelle
1.3k
Fork
246
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di firebase/firebaseui-web-react

Tutte le issue di firebase/firebaseui-web-react

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.