I tried to do it like how they do it in this post's answer how to check if file exists in Firebase Storage?
But I keep getting a error when I try to use that @google-cloud/storage package. Is there another way of checking if a file exists without catching and throwing an error?
This is how I'm currently uploading the file, which is an image, to my firebase
firebase.storage().ref('users/'+user.uid + '/profile.jpg').put(file.target.files[0]).then( () => {
console.log("Successfully uploaded image")
}).catch(error => {
console.log("Error uploading image: " + error);
});
This is the line of code that causes it to break
const {Storage} = require('@google-cloud/storage');
And I get this error in the console. util.js:602 Uncaught TypeError: The "original" argument must be of type Function
Any ideas or tips?