1

I am importing all the correct parts, but am getting an error that functions doesn't exist in firebase.

<script src="https://www.gstatic.com/firebasejs/7.8.2/firebase.js"></script>
<script src="https://www.gstatic.com/firebasejs/7.8.2/firebase-functions.js"></script>

When I call:

firebaseConfig = {My App details};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
db = firebase.firestore();
functions = firebase.functions();

The error is:

Uncaught TypeError: firebase.functions is not a function

gso_gabriel
  • 4,199
  • 1
  • 10
  • 22

1 Answers1

0

This type of error has very similar others that might occur on calling Firestore functions. For your error specifically, it seems that to fix your error you need to add require("firebase/functions") - as per the question Cloud functions with firebase: firebase.functions is not a function on the Community.

Let me know if the information helped you!

gso_gabriel
  • 4,199
  • 1
  • 10
  • 22