Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument of type 'WriteStream' is not assignable to parameter of type 'WritableStream'. #1535

Open
clementdemily opened this issue Jul 7, 2024 · 0 comments

Comments

@clementdemily
Copy link

clementdemily commented Jul 7, 2024

Bug Report

Description of the problem

Hey ! I'm using PDFkit since a few months and its working like a charm. I recently updated typescript and a new type error occurred when i'm using the .pipe() method with a WriteStream object ( created by fs.createWriteStream )

This is not causing any crash for my use cases.

Code sample

The type error is on the 4th line :

      const writeStream = fs.createWriteStream(this._pdfDocumentFilePath);
      writeStream.on("finish", () => resolve());
      writeStream.on("error", (e) => reject(e));
      this._pdfCreator.pipe(writeStream);
      this.createPdfFile(tale);

Type Error :

Argument of type 'WriteStream' is not assignable to parameter of type 'WritableStream'.
  Type 'WriteStream' is missing the following properties from type 'WritableStream': off, removeAllListeners, setMaxListeners, getMaxListeners, and 4 more.ts(2345)

Your environment

  • pdfkit version: 0.15.0
  • Node version: 18.20.2
  • Browser version (if applicable): nope
  • Operating System: macos / 14.5 (23F79)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant