Sunday, January 19, 2020

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.

Uncaught TypeError: Cannot read property 'GoogleAuthProvider' of undefined
    at script.js:31
Opening Chrome's development console and inspecting firebase.auth will also show that it is undefined.

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!

No comments:

Install Winget on Windows 2022 or Windows 10 LSTC

Install Winget on Windows 2022 or Windows 10 LTSC Install Pre-reqs Install Microsoft.UI.Xaml/2.8.6 Navigate to https://www.nuget.org/pa...