Open drewjs opened 5 years ago
https://nodejs.org/api/stream.html#stream_stream
import { Writable } from 'streams'
Should be:
import { Writable } from 'stream'
But i can confirm this issue, I got the same
It does exists, this is really bad, you must re-create the stream using the Hummus provided one. I coudl't find a way to detect the type of the stream if it's file system, buffer, or it's a Response stream.
There seems to be an issue using core Node
stream.Writable
for output. According to the docs, hummus should be able to use any writable stream. However you get errors when callingcreateWriter
andcreateWriterToModify
with the writable object.Tested similar code in Node 10 and 12:
However it works perfectly using
memory-streams
, which utilizesreadable-streams
as opposed to core Node streams:PDFStreamForResponse
only seems to utilize thewrite
method, so I'm not sure why there would be an incompatibility, but for now I would at least mention in the docs to avoid usingWritable
.