Skip to content

Error: libheif.HeifDecoder is not a constructor #22

Description

@dukesook

I'm trying to run libheif.js directly into an HTML page, but I'm getting the following error: libheif.HeifDecoder is not a constructor. Any ideas on what the problem is?

index.html

<script type="module" src="image_parser.js"></script>
<script type="module"> 
   import libheif from 'https://cdn.jsdelivr.net/npm/libheif-js@1.17.1/libheif-wasm/libheif-bundle.mjs'; 
</script>

image_parser.js

import libheif from 'https://cdn.jsdelivr.net/npm/libheif-js@1.17.1/libheif-wasm/libheif-bundle.mjs';
const decoder = new libheif.HeifDecoder();

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions