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

[BUG] Type 'ReadStream' is not assignable to type 'string | Buffer | ReadableStream<any> | undefined'. #212

Open
berke581 opened this issue Oct 3, 2022 · 0 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@berke581
Copy link

berke581 commented Oct 3, 2022

Describe the bug
I get TypeScript error Type 'ReadStream' is not assignable to type 'string | Buffer | ReadableStream<any> | undefined'. when I try the example code in Usage Docs. It works perfectly when I cast createReadStream's return value to any.

To Reproduce
Steps to reproduce the behavior:

  1. Using TypeScript
  2. const response = await client.upload({ image: createReadStream('/home/kai/dank-meme.jpg'), type: 'stream', });

Expected behavior
It should not give a TypeScript error.

Environment:

  • Library version: 2.2.0
  • OS: Windows 10
  • NodeJS version: 14.18.1
@KenEucker KenEucker self-assigned this Nov 7, 2022
@KenEucker KenEucker added documentation Improvements or additions to documentation bug Something isn't working labels Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants