I get "TypeError: fs.createReadStream is not a function" when I try to return some data from sightengine API from pictures.
Here is the loop I am using on a Vuejs project:
async runBlurDetector() {
console.log("Images uploaded")
console.log(this.images)
for (let i = 0; i < this.images.length; i++) {
this.images[i].url = URL.createObjectURL(this.images[i]);
var reader = new FileReader();
reader.onload = () => {
this.images[i].image = reader.result;
};
reader.readAsDataURL(this.images[i]);
await this.blurDetector(this.images[i]);
}
},
blurDetector(image) {
console.log("Blur Detector Starting....");
console.log(image)
sightengine.check(['properties']).set_file("../assets/images/" + image.name).then(function (result) {
// The result of the API
console.log(result)
}).catch(function (err) {
// Error
console.log(err)
});
}
}```
I get the following error:
```TypeError: fs.createReadStream is not a function
at Object.client.set_file (sightengine.js?cdad:37:1)
at VueComponent.blurDetector (Dashboard.vue?98fa:94:1)```