ngCordova camera

Hi I have a problem with the camera.

To provide my app with data I use a socket based database similar to Firebase and it works just fine.

And what I want to add is the ability to take a picture and upload that so I add the file, camera and file-transfer plugins, and after that no data is showing in my app anymore, and as soon as I remove them again it works…

I get this error

TypeError: reader.addEventListener is not a function. (In 'reader.addEventListener('loadend', onLoadEnd, false)', 'reader.addEventListener' is undefined)
blobToBufferrethinker.js:6127
onmessage

Could there be some kind of conflict?

I found what seems to be the problem.

the file plugin has a file named FileReader.js that has module.exports = FileReader

and in rethinker.js blobToBuffer is using FileReader, but the filereader in the cordova file doesn’t seem to have the addEventListener prototype on it.

so what would be the best way to solve this, renaming the module.exports I guess?

the issue was that the FileReader constructor of cordova file was overriding the original FileReader, I solved it by changing the target of the plugin to
<clobbers target="window.FileReaders" /> instead of <clobbers target="window.FileReader" />

And now it works again, probably not the best solution.

But I don’t know why one would override the original window.FileReader…