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

fix: Add stub ReadableStream declaration #32

Closed
wants to merge 1 commit into from

Conversation

LinusU
Copy link

@LinusU LinusU commented Oct 10, 2024

The patch here will make this library usable without including the dom typings, which usually is not desirable in a pure Node.js project.

This is the same approach used by the AWS SDK, ref: aws/aws-sdk-js-v3#6554

Without this, there is an error when trying to use this package (or in my case, the got package) in Node.js:

node_modules/form-data-encoder/lib/index.d.ts:30:15 - error TS2304: Cannot find name 'ReadableStream'.

30     stream(): ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
                 ~~~~~~~~~~~~~~


Found 1 error in node_modules/form-data-encoder/lib/index.d.ts:30

@octet-stream
Copy link
Owner

octet-stream commented Oct 10, 2024

Hello, thanks for your contribution.
The issue was already discussed here and here. As I said, my library is not the right place for the fix. Please open a PR to https://github.com/DefinitelyTyped/DefinitelyTyped instead and add proper typings for @types/node package.

@octet-stream
Copy link
Owner

There's also discussion in DefinitelyTyped repo about this problem, still w/o any response: DefinitelyTyped/DefinitelyTyped#69452

@LinusU
Copy link
Author

LinusU commented Oct 11, 2024

Turns out that this was fixed by https://github.com/DefinitelyTyped/DefinitelyTyped/pull/70269/files

Sorry for the noise...

@LinusU LinusU closed this Oct 11, 2024
@LinusU LinusU deleted the lu-fix branch October 11, 2024 10:28
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

Successfully merging this pull request may close these issues.

2 participants