-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updateCurrentUser failed: First argument "user" must be an instance of Firebase User or null. #536
Comments
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. |
@juanmaguitar I tried with "firebase": "5.7.1" and "firebaseui": 3.2.0 as react-firebaseui used. But cannot reproduce the error you mentioned. updateCurrentUser is called here for every sign-in operation: https://github.com/firebase/firebaseui-web/blob/master/javascript/widgets/authui.js#L1653. And the error is thrown from firebase core SDK complying about the provided argument is not a User object. So I'd appreciate it if you could print some trace of the user object passed to updateCurrentUser and build the firebaseui library yourself to help us investigate the issue. Otherwise, without being able to reproduce, it's really hard to help. |
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). |
@WriterDuet I don't quite follow. If the two versions are the same, why would that cause the type error? |
Also hit this - can't explain what was going on, but eventually fixed it by replacing some imports of |
If you are using loading firebase by via scripts then you can't use the npm versions, and also not the firebaseui npm version. I had the same issue bue resolved it by loading all the firebase and firebaseui scripts via <script> tag instead of npm. |
I saw this same error using vuejs-cli, webpack, typescript, and a locally built firebaseui node module. This work-around worked for me: Only list firebaseui in my project's packages.json: "dependencies": {
"firebaseui": "file:../../../firebaseui-web",
} Import the firebase modules from firebaseui's import firebase from "firebaseui/node_modules/firebase/app";
import "firebaseui/node_modules/firebase/functions";
import * as firebaseui from "firebaseui";
import "firebaseui/dist/firebaseui.css"; I'm afraid I've built a house of cards. Is this technically sound? Is there a better way? |
Describe your environment
"react-firebaseui": "^3.1.2"
"firebase": "5.7.1"
Describe the problem
I'm using the
https://github.com/firebase/firebaseui-web-react
wrapperMy 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
No
signInSuccessUrl
redirection orsignInSuccessWithAuthResult
callback works after this errorI have no clue about how to debug this or what would be the error
Any ideas?
The text was updated successfully, but these errors were encountered: