Firebase getting "Uncaught TypeError: Cannot read property 'GoogleAuthProvider' of undefined at script.js:xy
I was trying to follow the documentation on "Adding Firebase to your Google Cloud project" but for the life of me I can't get the authentication to work.
Anyway, the fix is really easy but it was not apparent, at least for me, that I need to add the following in index.html.
<script src="https://www.gstatic.com/firebasejs/7.6.2/firebase-auth.js"></script>
Enjoy!
Uncaught TypeError: Cannot read property 'GoogleAuthProvider' of undefinedOpening Chrome's development console and inspecting firebase.auth will also show that it is undefined.
at script.js:31
Anyway, the fix is really easy but it was not apparent, at least for me, that I need to add the following in index.html.
<script src="https://www.gstatic.com/firebasejs/7.6.2/firebase-auth.js"></script>
Enjoy!
Comments