Closed Amr2812 closed 3 years ago
@nuxtjs/firebase: ^7.5.0 firebase: ^8.3.1 nuxt: ^2.14.6
Nuxt Running in SPA mode (No Server Side Rendering) with target static, the problem is it does delete the file then gives me the Error: Cannot read property 'delete' of undefined so the rest of the async function doesn't complete!
Cannot read property 'delete' of undefined
async deleteFunction () { try { this.deleteLoading = true; await this.$fire.storage .ref("CVs/") .child(this.$store.state.auth.user.uid) .delete(); await this.$fire.firestore .collection("users") .doc(this.$store.state.auth.user.uid) .update({ cv: this.$fire.firestore.FieldValue.delete(), }); this.cvLink = null; this.deleteLoading = false; this.$notifier.showMessage({ color: "success", content: "Current CV Deleted Successfully", }); } catch (err) { this.$notifier.showMessage({ color: "red", content: err, }); this.deleteLoading = false; } }, }
Deletes the file without errors
Deletes the file and gives error: Cannot read property 'delete' of undefined
Solved: Discovered that the error was from the firestore delete because I had to use $fireModule instead of $fire
Version
@nuxtjs/firebase: ^7.5.0 firebase: ^8.3.1 nuxt: ^2.14.6
Steps to reproduce
Nuxt Running in SPA mode (No Server Side Rendering) with target static, the problem is it does delete the file then gives me the Error:
Cannot read property 'delete' of undefined
so the rest of the async function doesn't complete!My Function:
What is Expected?
Deletes the file without errors
What is actually happening?
Deletes the file and gives error:
Cannot read property 'delete' of undefined