Skip to content

error TS2322: Type 'Uint8Array<ArrayBufferLike>' is not assignable to type 'BlobPart'. #282

@FrankBuchholz

Description

@FrankBuchholz

Hi Przemek,

I tried to rebuild by local installation now using npm run build, however, this time I got the following error (some month ago it worked without errors):

src/datasource/load_data.ts:66:58 - error TS2322: Type 'Uint8Array<ArrayBufferLike>' is not assignable to type 'BlobPart'.
  Type 'Uint8Array<ArrayBufferLike>' is not assignable to type 'ArrayBufferView<ArrayBuffer>'.
    Types of property 'buffer' are incompatible.
      Type 'ArrayBufferLike' is not assignable to type 'ArrayBuffer'.
        Type 'SharedArrayBuffer' is missing the following properties from type 'ArrayBuffer': resizable, resize, detached, transfer, transferToFixedLength

66       images.set(fileName, URL.createObjectURL(new Blob([unzipped[fileName]])));

I don't understand what's happening, but I found the discussion TypeScript/issues/62546 about the same error code which suggest to solve it this way - and it worked fine:

      // Save image for later.
      const imageBuffer = new Uint8Array(unzipped[fileName]);
      images.set(fileName, URL.createObjectURL(new Blob([imageBuffer])));

Greetings,
Frank

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions