Struggling to implement image uploads in a VueJS app following this guide. However, I keep encountering the error:
TypeError: _config_firebaseInit__WEBPACK_IMPORTED_MODULE_2__.default.storage is not a function
Below is my firebase initialization file:
import firebase from "firebase";
import "firebase/storage";
import firebaseConfig from "./firebaseConfig";
const firebaseApp = firebase.initializeApp(firebaseConfig);
var storage = firebase.storage();
export default firebaseApp.firestore();
The form includes a vue-dropzone element with the following code:
import firebase from "../../../config/firebaseInit";
import { uuid } from "vue-uuid";
import vue2Dropzone from "vue2-dropzone";
import "vue2-dropzone/dist/vue2Dropzone.min.css";
export default {
name: "new-listing",
components: {
vueDropzone: vue2Dropzone
},
data() {
return {
// data values here
};
},
methods: {
saveListing() {
// saving listing logic here
},
async afterComplete(upload) {
// image upload logic here
}
}
};
I've referred to the Firebase documentation here, but still can't seem to resolve it.