-
Notifications
You must be signed in to change notification settings - Fork 893
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
getDoc() is never resolved nor rejected #5402
Comments
I have been trying to start the conversion process from 8 and am seeing a similar issue with 9.0.0 in both compat mode and new mode. Neither docRef.get() or getDoc seem to do anything (no debug messages with debug on, no network requests, no error, no return). Auth and database seem to be working in compat mode on same project. The database object and doc object seem to coming back with filled in data. |
Hello @laurentpayot. Thank you for reporting this issue. I have attempted to reproduce this "hang" myself without success. Would you be able to create a minimal reproduction app? This bug is especially insidious because there are no logs whatsoever produced which makes debugging near impossible. If you can, could you publish this app into GitHub where I can clone it and reproduce the hang? With that, it should be relatively straight-forward to fix. Thank you. |
Adding to my comment on @laurentpayot's post. |
@dconeybe I created a minimal reproduction app at https://github.com/laurentpayot/sscce-firebase @GaryAustin1 you are right, Note that Rollup has a similar issue that is caused by the lastest TypeScript version that appeared around the same time as v9. Could the issue come from the buggy TS version Firebase v9.0.0 was transpiled with? |
So I have my case narrowed to the order of setting persistence and auth init.... `firebase.initializeApp(firebaseConfig) enableIndexedDbPersistence(firestoreDb) // persistence first does not work const unregisterAuthObserver = firebase.auth().onAuthStateChanged(user => { const docRef = doc(firestoreDb, "users",userId); If I move the enableIndexedDbPersistence(firestoreDb) right after firebaseui.auth it works.... edit: I removed ui and just did firebase.auth and that was sufficient to cause the issue so not dependent of firebaseui |
Thank you both for all of this info. I'll be digging into this further tomorrow. |
@dconeybe I will take a look at this. |
This occurs for me since 9.0.0 beta 3. I stayed at beta 2 until now. But today upgraded my code and introduced a timeout, to make sure that the auth is resolved, before I am calling getDoc. Without changing anything else, it works again! |
Is this issue resolved yet as I'm facing it still occuring with [email protected]. |
@maxfahl What version are you using? If you are on the latest version, do you mind sharing debug logs? |
[REQUIRED] Describe your environment
Note that I'm running Firestore in a web worker.
[REQUIRED] Describe the problem
Steps to reproduce:
got doc
is never logged (see code below)Everything was fine with the v9 beta. The official, non-beta release broke it.
Relevant Code:
Related to #5398?
The text was updated successfully, but these errors were encountered: