question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Cannot read property 'PROVIDER_ID' of undefined" error on version 2.1.1

See original GitHub issue

For some reason, when clicking on any button results on this JavaScript error

firebaseui.js:331 Uncaught TypeError: Cannot read property 'PROVIDER_ID' of undefined
    at firebaseui.js:331
    at b (firebaseui.js:331)
    at firebaseui.js:73
    at ol.<anonymous> (firebaseui.js:273)
    at cf (firebaseui.js:148)
    at Bg.h.dispatchEvent (firebaseui.js:147)
    at Dg (firebaseui.js:184)
    at Bg.Tc (firebaseui.js:183)
    at af (firebaseui.js:144)
    at HTMLButtonElement.We (firebaseui.js:145)

My initialization code:

<script>
          var config = window.settings.FirebaseCredentials;
          firebase.initializeApp(config);
</script>
<script src="https://cdn.firebase.com/libs/firebaseui/2.1.1/firebaseui.js"></script>
<script>

   var uiConfig = {
        signInSuccessUrl: "/",
        signInOptions: [
            // Leave the lines as is for the providers you want to offer your users.
            firebase.auth.GoogleAuthProvider.PROVIDER_ID,
            firebase.auth.GithubAuthProvider.PROVIDER_ID,
            firebase.auth.TwitterAuthProvider.PROVIDER_ID,
            firebase.auth.FacebookAuthProvider.PROVIDER_ID
        ],
        tosUrl: "http://howlbits.com"
    };

    // Initialize the FirebaseUI Widget using Firebase.
    var ui = new firebaseui.auth.AuthUI(firebase.auth());
    // The start method will wait until the DOM is loaded.
    ui.start('#firebase-auth-container', uiConfig);
...

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
shaktikathpaliacommented, Jul 26, 2019

Adding <script src="https://www.gstatic.com/firebasejs/6.3.2/firebase-auth.js"></script> worked for me

1reaction
ChrisBlueSpurscommented, May 28, 2018

Thank you! This did lead to a solution but interestingly, it was nothing to do with firebaseAuthObj and everything to do with importing firebase and firebaseui. I had used

let fire = require ('firebase');
let firebaseui = require('firebaseui');

let config = { ... };

let firebase = fire.initializeApp(config);

Changing this simply to:

import firebase from 'firebase';
import firebaseui from 'firebase';

let config = { ... };

firebase.initializeApp(config);

Made it work. Interesting that the way I was doing it actually gave me working access to cloud firestore, but problems with firebase auth. Anyway, thanks very much for the help, still fairly new to React and ES6. Hopefully this can help someone else if they ever come across it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'GoogleAuthProvider' of undefined ...
but i'm getting this error when i access the page. (index):49 Uncaught TypeError: Cannot read property 'GoogleAuthProvider' of undefined at ...
Read more >
cannot read properties of undefined (reading 'auth') firebase
i am new to using react native and firebase, I have this error: "TypeError: Cannot read property 'auth' of undefined" I proceed to...
Read more >
Easily add sign-in to your Web app with FirebaseUI - Google
In the Firebase console, open the Authentication section and enable email and password authentication. · Add the email provider ID to the list...
Read more >
firebase - UNPKG
The object\n * is not found if null or undefined. If you are using a compilation pass that\n * renames property names beware...
Read more >
OCPI 2.2 - EVRoaming Foundation
OCPI 2.1.1 is a different protocol version of OCPI than OCPI 2.1. ... Otherwise the data field is unspecified and MAY be omitted,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found