Skip to content

Cannot create blob from result.pdf #8

Description

@slashinfty

I am attempted to compile as stated in the readme (using typescript and svelte):

import { SiglumCompiler } from '@siglum/engine';
const compiler = new SiglumCompiler({
    bundlesUrl: '/bundles',
    wasmUrl: '/busytex.wasm',
    workerUrl: '/worker.js',  // Explicit path to copied worker
});
await compiler.init();

/* inside an async function in the same file */
const result = await compiler.compile(input);
if (result.success) {
    return new Blob([result.pdf], { type: 'application/pdf' });
}

However, I receive this error:

Type 'Uint8Array | undefined' is not assignable to type 'BlobPart'.
Type 'undefined' is not assignable to type 'BlobPart'.

If I do result.pdf! to remove the possibility of undefined, I get the following error:

Type 'Uint8Array' is not assignable to type 'BlobPart'.
Type 'Uint8Array' is not assignable to type 'ArrayBufferView'.
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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions