React + Firebase Auth works, but Firestore user document is not being created after signup #202420
Replies: 2 comments
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
|
Welcome to the GitHub Community, @G-Mustafa9500! You are more likely to get a useful response if you are posting your question(s) in the applicable category and are explicit about what your project entails--giving a few more details might help someone give you a nudge in the right direction. I've gone ahead and moved it for you. Good luck! |
Uh oh!
There was an error while loading. Please reload this page.
🏷️ Discussion Type
Bug
💬 Feature/Topic Area
Issues
Body
Hi everyone,
I'm building a React (Vite) + Firebase application and I'm stuck on a Firestore issue.
What works
✅ React + Vite
✅ Firebase Authentication (Email/Password)
✅ Google Sign-In
✅ Firebase project configured
✅ Firestore Database created
✅ Firebase Storage working
The Problem
Authentication is successful, but after a user signs up, the Firestore user document is not created.
I'm creating the document using:
await setDoc(doc(db, "users", user.uid), {
uid: user.uid,
name,
email,
createdAt: serverTimestamp(),
});
However, the document never appears in Firestore.
Console Error
FirebaseError: Failed to get document because the client is offline.
Previously I also received:
Database '(default)' not found.
What I've Already Checked
Created a new Firebase project
Verified Firebase configuration
Enabled Firestore Database
Tested Firestore Security Rules
Authentication works correctly
Google Sign-In works
Internet connection is stable
The same project works when writing documents manually from the Firebase Console
My Question
Why would Firebase Authentication work correctly while Firestore refuses to create or read documents from my React application?
Has anyone experienced this issue before?
I'd really appreciate any suggestions or debugging ideas.
Thank you! 🙏
Tech Stack
React 19
Vite
Firebase v12
Firestore
Firebase Authentication
JavaScript
Guidelines
All reactions