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
in v3.2 the "stream" arg for a MessageAttachment expects fs.ReadStream. But that means other types of streams (not from filesystem) will throw an error. Instead, you should use the type import {Readable} from "stream" - or even the lower level NodeJS.ReadableStream, which is all that you need to ensure the type has the .readable property and can be piped.
importzlibfrom'zlib';importfsfrom'fs';import{MessageAttachment}from'emailjs';constattachment: MessageAttachment={// this will throw typescript type error, because createGzip() resolves to Transform type (which extends Readable)stream: fs.createReadStream(logpath).pipe(zlib.createGzip())}
The text was updated successfully, but these errors were encountered:
in v3.2 the "stream" arg for a MessageAttachment expects fs.ReadStream. But that means other types of streams (not from filesystem) will throw an error. Instead, you should use the type
import {Readable} from "stream"
- or even the lower levelNodeJS.ReadableStream
, which is all that you need to ensure the type has the.readable
property and can be piped.Relevant line:
https://github.com/eleith/emailjs/blob/v3.2.0/smtp/message.ts#L51
Reproduce Error:
The text was updated successfully, but these errors were encountered: