firebase / firebase/firebaseui-web-react

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

Đang mở
#90 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
1.3k
Fork
246
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện sự cố trên Firebase Hosting với script dành riêng /__/firebase/init.js và component StyledFirebaseAuth bằng cách sử dụng firebase.auth(). Kiểm tra cách instance Firebase từ CDN tương tác với dependency FirebaseUI được tải qua npm. Được xem là hoàn thành khi đã xác lập và lập tài liệu cho một thiết lập được hỗ trợ, tránh được cả cảnh báo duplicate-global lẫn lỗi updateCurrentUser.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
firebase, javascript, react
Lĩnh vực
authentication, frontend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.