[Vuejs]-VueJS – Display Input Image Kills Browser

0👍

Seems like reader.onloadend is never called, and because of using async & await fileChange method never ends which causes browser to stop responding.

In order to see what is the problem you should also set FileReader.onerror , like this:

async loadImage (file) => {
  return new Promise((resolve, reject) => {

    const reader = new FileReader()
    reader.onerrror = reject();
    // ..
  })
}

read more

Leave a comment