firebase / firebase/firebaseui-web-react

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

オープン
#90 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
1.3k
フォーク
246
PR マージ指標
30日以内にマージされた PR はありません

説明

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 (``)

Later, when `` 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](https://github.com/firebase/firebaseui-web/issues/536#issuecomment-451788176).

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、予約済みスクリプト /__/firebase/init.js と StyledFirebaseAuth コンポーネントを使用し、firebase.auth() で Firebase Hosting 上の問題を再現します。CDN の Firebase インスタンスが npm で読み込まれた FirebaseUI 依存関係とどのように相互作用するかを確認します。duplicate-global 警告と updateCurrentUser エラーを回避するサポート対象の構成を確立し、文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
firebase, javascript, react
領域
authentication, frontend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。