in Education by
I am getting the error 'Uncaught TypeError: firebase.auth is not a function'. My code was working perfectly, and then I implemented my clients api, and discovered that their api already uses and has initialized a different firebase app. So, as I couldn't initialise my firebase app in the usual way (ie. firebase.initializeApp(config) ), I followed the documentation on initializing multiple firebase apps as follows. (This results in the error) var configOther = { apiKey: "xxxx", authDomain: "xxxx", databaseURL: "xxxx", projectId: "xxxx", storageBucket: "xxxx", messagingSenderId: "xxxx" }; var firebaseOther = firebase.initializeApp(configOther, "firebaseOther"); console.log("auth: ", firebase.auth(firebaseOther)); //"Uncaught TypeError: firebase.auth is not a function" Any ideas about what I'm doing wrong here? Many thanks. Note - I have also tried the following shorthand notation: firebaseOther.auth() instead of firebase.auth(firebaseOther) but this results in the same error. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You likely skipped the step for including the firebase-auth script in your page, as described by the documentation: <!-- Firebase App is always required and must be first --> <!-- Add additional services that you want to use -->

Related questions

0 votes
    My node 8 function, hosted at Firebase Cloud Functions isn't working as expected. I've a toLocaleString ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    My node 8 function, hosted at Firebase Cloud Functions isn't working as expected. I've a toLocaleString ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 4, 2022 in Education by JackTerrance
0 votes
    Details If you use the function createCustomToken to sign in the user and setting his custom claim, updating ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 3, 2022 in Education by JackTerrance
0 votes
    I am using Firebase authentication and react-redux in my app. I added firebase.auth().onAuthStateChanged to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    I am using Firebase authentication and react-redux in my app. I added firebase.auth().onAuthStateChanged to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 16, 2022 in Education by JackTerrance
0 votes
    I'm trying to make a function in c to create and return a new struct similar to a constructor in ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    Can abstract keyword be used with constructor, Initialization Block, Instance Initialization and Static Initialization ... Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Is there any way to add a custom parameter to identityserver auth request. I tried this way. but it ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    On my site, when you log in, I want to keep these sessions alive for 10 hours. Right now my ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 20, 2022 in Education by JackTerrance
0 votes
    What is the purpose of the Auth tab in the testing platform? (a) To specify credentials (b) To ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    My code: PhoneAuthProvider.getInstance().verifyPhoneNumber( phoneNumber, // Phone number to verify 60, // Timeout ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    I am trying to intitialize my Collection View Model which holds a list of [Users] with a firebase snap ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    It is possible to use email verification with firebase but instead of sending a link they have to click, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    We have recently moved to Tomcat 8.5.4 (from 8.5.3) and to Omnifaces 2.4 (from 2.3), ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
...