You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importgotfrom'got';import{fileTypeStream}from'file-type';consturl='https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg';conststream1=got.stream(url);conststream2=awaitfileTypeStream(stream1,{sampleSize: 1024});if(stream2.fileType&&stream2.fileType.mime==='image/jpeg'){// stream2 can be used to stream the JPEG image (from the very beginning of the stream)console.log('works');}
Throws an error:
Error: Failed to pipe. The response has been emitted already.
at Request.pipe (C:\Users\Borewit\code\github\examples\node_modules\got\dist\source\core\index.js:1476:19)
at Function.pipeline (node:internal/streams/pipeline:284:13)
at Request.<anonymous> (C:\Users\Borewit\code\github\file-type\core.js:1432:26)
at Object.onceWrapper (node:events:513:28)
at Request.emit (node:events:394:28)
at emitReadable_ (node:internal/streams/readable:571:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
The text was updated successfully, but these errors were encountered:
Seen any progress with this or know any workaround? I've picked up the latest version of got which should have this update, but still getting the error.
Throws an error:
The text was updated successfully, but these errors were encountered: