You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constdata=newTextEncoder().encode("hello")// ^? Uint8Array<ArrayBufferLike>// The `ArrayBufferLike` may include `SharedArrayBuffer`, but `encode()` // only supports `ArrayBuffer`, so this breaks code expecting an `ArrayBuffer`.functionprocessData(d: ArrayBuffer){// do stuff}processData(data.buffer)// This should work, but reported as type error
π Actual behavior
Values returned by TextEncoder.encode are not assignable to ArrayBuffer.
π Expected behavior
Values returned by TextEncoder.encode should be assignable to ArrayBuffer.
π Search Terms
TypedArray, Uint8Array, ArrayBufferLike, TextEncoder
π Version & Regression Information
β― Playground Link
Playground link
π» Code
π Actual behavior
Values returned by TextEncoder.encode are not assignable to
ArrayBuffer
.π Expected behavior
Values returned by TextEncoder.encode should be assignable to
ArrayBuffer
.Additional information about the issue
https://stackoverflow.com/a/79300250/1494725
The text was updated successfully, but these errors were encountered: