Search code examples
javascriptfirebase-storagefirebase-tools

Firebase Storage in Web Application: storage.useEmulator is not a function


In my local web application development environment the web application is accessing the Firestore emulator correctly, but not the Storage emulator. Instead it accesses the production storage.

I load the module from http://localhost:5000/__/firebase/8.3.0/firebase-storage.js

I have tried this from https://firebase.google.com/docs/emulator-suite/connect_storage#web-v8:

var storage = firebase.storage();
storage.useEmulator("localhost", 9199);

But the useEmulator function does not exist. How can this be?


Solution

  • The function storage.useEmulator was introduced in a later version of firebase.