I’m not so expert with fs of node.js, but I tried to do a thing like this, following the example in this module : html-convert - npm to convert html to gif, in async function :
var htmlConvert = require('html-convert'); var fs = require('fs'); var convert = htmlConvert({ fetchTimeout: 10000, renderTimeout: 3000, format: 'gif', width: 607, height: 403, phantomFlags: ['--ignolsre-ssl-errors=true'], maxRenders: 1000, }); await fs.createReadStream('public/profilogif.html') .pipe(convert()) .pipe(fs.createWriteStream("assets/profilogif.gif"));
But it threw this error
And so I removed this part
.pipe(fs.createWriteStream("assets/profilogif.gif"));
and the error was not thrown anymore.
So, I think that the problem is the assets folder. Any idea?