-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
FirebaseAuth instance is null for Flutter Web #1635
Comments
Hi @vinceMuni |
Hi there, yes sure. Here following my flutter doctor:
Here my flutter run --verbose:
Here the code snippet where I am using FirebaseAuth:
Thank you for your help. |
Did you do the setup changes on Take a look at the web example to see the initialization. |
This really needs to be added to the documentation at one of: https://pub.dev/packages/firebase_auth I hadn't seen anything about setting up the script tag before this. |
@TannerYoung @vinceMuni you're right, I think it's a good action item for this ticket. What documentation changes would you like to see? A specific "web setup" in the core plugin, and setup in the web version? A link to the web example? |
I think specifically mentioning the data that needs to be added from the guide in step 1 of https://firebase.google.com/docs/web/setup#register-app I already had my firebase app set up for android, and I just wasn't aware of the significance of adding web capabilities to the firebase app in the console |
Related issue: #1746 |
What is missing from the firebase SDK web widget is this <script src="https://www.gstatic.com/firebasejs/7.13.2/firebase-auth.js"></script>As previously mentioned the snippet with the auth.js script should be added at the end of the body and before the script containing the dart.js |
@dimitris1pana what do you mean by "the firebase SDK web widget"? Thanks! |
@dimitris1pana but Step 3 of that page, in the "From CDN" setup, lists From the link you shared: <body>
<!-- Insert these scripts at the bottom of the HTML, but before you use any Firebase services -->
<!-- Firebase App (the core Firebase SDK) is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.13.2/firebase-app.js"></script>
<!-- If you enabled Analytics in your project, add the Firebase SDK for Analytics -->
<script src="https://www.gstatic.com/firebasejs/7.13.2/firebase-analytics.js"></script>
<!-- Add Firebase products that you want to use -->
<script src="https://www.gstatic.com/firebasejs/7.13.2/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.13.2/firebase-firestore.js"></script>
</body> |
I added both: <script src="https://www.gstatic.com/firebasejs/7.13.2/firebase-auth.js"></script> <script src="https://www.gstatic.com/firebasejs/7.13.2/firebase-firestore.js"></script>to my index.html file, but I am still getting the error. Any suggestions? |
@andressilvac please create a new issue with as much detail as you can. This one has been closed for months, and it'll only be seen by people who participated in it in the first time. |
I tried to deploy my app on Chrome.
Trying to sign in, it fails because
FirebaseAuth.instance
results as null.Is there any adding configuration I need to setup?
PS: It runs smoothly on both iOS and Android
The text was updated successfully, but these errors were encountered: