I encountered an issue when adding the cordova-plugin-file-transfer plugin, where I received the error message:
reader.addEventListener is not a function
.
This problem arises due to Cordova FileReader class overriding typescript FileReader.
How can this be prevented?
Is it possible to import the native FileReader class instead?
Below is the function causing the error:
createImageFromBlob(image: Blob) {
let reader = new FileReader();
reader.addEventListener("load", () => {
this.profilePicture = reader.result;
}, false);
if (image) {
reader.readAsDataURL(image);
}
}