Uncaught TypeError: firebase_app__WEBPACK_IMPORTED_MODULE_4__.default.storage is not a function 1

Uncaught TypeError: firebase_app__WEBPACK_IMPORTED_MODULE_4__.default.storage is not a function

I faced the same problem. In my case, I needed to include storage module besides Firebase core.

import firebase from 'firebase';
import 'firebase/storage';  // <----

firebase.initializeApp({
  ...
});
const storageRef = firebase.storage().ref();

Here is what the above code is Doing:
1. Importing the Firebase module from the Firebase SDK.
2. Importing the Firebase Storage module from the Firebase SDK.
3. Initializing the Firebase app.
4. Creating a reference to the storage bucket location.

Similar Posts