[Vuejs]-Sometimes getting: Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'

0👍

You need to check whether the value you have as input is a blob:

selectImage(e) {
  const selectedImage = e.target.files[0]; // get image
  if (selectedImage instanceof Blob) {
    this.createBase64Image(selectedImage);
  } else {
    //not a blob, cancel/close happened
  }
},

and in the else branch you can do some handling for the case when cancel/close occurred

Leave a comment