Currently, I am encountering an issue while attempting to upload an image on Firebase Cloud Storage using web Javascript. The error message "firebase.firestore() is not a function" is being displayed in my console. Do you think I might be going about this the wrong way?
Up until now, I have successfully inserted and fetched data in Firebase Database. However, when it comes to uploading images on Firebase Cloud Storage, I seem to have hit a roadblock.
<script src="https://www.gstatic.com/firebasejs/6.2.3/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.2.3/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/3.1.0/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/6.3.0/firebase-firestore.js"></script>
var firebaseConfig = {
apiKey: "XXX",
authDomain: "XXX",
databaseURL: "XXX",
projectId: "XXX",
storageBucket: "XXX",
messagingSenderId: "XXX",
appId: "XXX"
};
// Initialize Firebase
var defaultProject = firebase.initializeApp (firebaseConfig);
// Obtain a reference to the database service
var fileName = selectedFile.name;
var storageRef = firebase.firestore().ref('image' + fileName).put(selectedFile);