Skip to content Skip to sidebar Skip to footer

TypeError: Cannot Read Property 'length' Of Undefined - Firebase

I am trying to connect to Firebase. Code from firebase.js: import * as firebase from 'firebase/compat/app'; const firebaseConfig = { apiKey: '***', authDomain: '***', projec

Solution 1:

You're missing imports for Firestore (as the error mentions) and Authentication.

import * as firebase from "firebase/compat/app";
import 'firebase/compat/auth';
import 'firebase/compat/firestore';

Also see the documentation on updating imports to v9 compat.


Solution 2:

As I said in my comment on your other thread, firebase imports have changed recently. Try to change fribase to firebase/compat/app Documentation


Post a Comment for "TypeError: Cannot Read Property 'length' Of Undefined - Firebase"