I am trying to implement a simple Flutter Web App, with Firebase Auth.
I am getting the error NoSuchMethodError: tried to call a non-function, such as null: \'dart.
Turns out I placed this
<!-- Firebase Configuration-->
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-app.js"></script>
<!-- TODO: Add SDKs for Firebase products that you want to use
https://firebase.google.com/docs/web/setup#available-libraries -->
<script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-auth.js"></script>
<!-- <script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-analytics.js"></script> -->
<script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-storage.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-database.js"></script>
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
//my info
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
// firebase.analytics();
</script>
<!-- End of Firebase Configuration-->
In the wrong place.
It should be inside the <head>
tag.
Side note, I had this <script src="https://www.gstatic.com/firebasejs/7.15.5/firebase-app.js"></script>
twice, so I deleted the one below.
Finally, thanks to David Iglesias for his answer here: https://github.com/FirebaseExtended/flutterfire/issues/2860#issuecomment-651313186.