-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Blob
type is incompatible with node definition of Blob
#53668
Comments
The default config includes the DOM (i.e. web browser API) types; since you're targeting Node, you should install |
It sounds like this is a problem in the node .d.ts, not the DOM's. |
@RyanCavanaugh isn't this essentially the same as #52166? |
This issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
In light of this response can this issue be re-opened and addressed as part of the 5.1.0 milestone along with #52166 and any other |
This comment was marked as duplicate.
This comment was marked as duplicate.
@RyanCavanaugh can this issue please be re-opened per #53668 (comment) |
As discussed in microsoft/TypeScript#53668 the @types/node definition of a buffer is looser and hence we should use that in order to be compaible with web buffer types and node buffer types
* fix: use @types/node buffer type rather than lib.dom.ts As discussed in microsoft/TypeScript#53668 the @types/node definition of a buffer is looser and hence we should use that in order to be compaible with web buffer types and node buffer types * chore: run lint:fix * chore: test saveFileInContainer for buffers * chore: test buffers on overwriteFile * chore: don't test blob on node 14 * chore: update changelog for new buffer definition * Update e2e/node/resource.test.ts Co-authored-by: Zwifi <nseydoux@inrupt.com> * Update CHANGELOG.md Co-authored-by: Zwifi <nseydoux@inrupt.com> * chore: cleanup tests from review * chore: remove unecessary type casting --------- Co-authored-by: Zwifi <nseydoux@inrupt.com>
lib Update Request
Configuration Check
My config is the default config created by running
npm init -y && npx tsc --init
. No packages have been installed.Node Version: v19.3.0
NPM Version: 9.6.2
Missing / Incorrect Definition
The
Blob
type defined here https://github.com/microsoft/TypeScript/blob/e83d61398ea0e4231e882121dd6c6bcfe4fdc9e4/src/lib/dom.generated.d.ts#L3075 is not assignable to theBlob
type in node here https://github.com/DefinitelyTyped/DefinitelyTyped/blob/ec8923e261d3619aef6a4663d50159e7e0dcf3e9/types/node/buffer.d.ts#L121 due to type applied to theprototype
.Sample Code
Causes the typescript compilation error
The text was updated successfully, but these errors were encountered: