Open Yonom opened 5 hours ago
The TS 5.7 release notes and #59417 explain what's going on here. If you want a Uint8Array
whose buffer
property is a suitable BlobPart
you'll have to ask for it explicitly like
const toBlob = (data: Uint8Array<ArrayBuffer>, type: string) => {
return new Blob([data.buffer], { type });
}
And of course that might have to propagate throughout your code base. Maybe the TS team has a recommendation for how to proceed in general with this sort of thing; the release notes only mention updating node.
π Search Terms
ArrayBufferLike BlobPart SharedArrayBuffer ES2024
π Version & Regression Information
5.7.2
and5.6.3
β― Playground Link
https://www.typescriptlang.org/play/?target=11&ts=5.7.2#code/MYewdgzgLgBFICEA2IBGMC8MAUATAhlPgFwwCqAlmFABwCCATg-gJ4A0cLADgKanQMqAcwCUmAHwwA3jABQMGAx5QArgzAwwPAO4xkabAG0CRAHSoVAM0s8GAXQ4yo3HjAC+IgNyy3QA
π» Code
When targetting ES2024, the following code throws a type error:
π Actual behavior
π Expected behavior
Backwards compatibility with ES2023
Additional information about the issue
No response