jamsinclair / jSquash

Browser & Web Worker focussed wasm bundles derived from the Squoosh App.
Apache License 2.0
222 stars 14 forks source link

Deno fails with "NotSupported: Classic workers are not supported." #42

Open jamsinclair opened 9 months ago

jamsinclair commented 9 months ago

Describe the bug Using a multi-threaded supported module fails with:

NotSupported: Classic workers are not supported.

Reproduction

import encode from '@jsquash/avif/encode';

await encode(new ImageData(new Uint8ClampedArray(4 * 50 * 50), 50, 50));

Expected behavior Should work without additional configuration.

jamsinclair commented 9 months ago

Looks like this may be solved by https://github.com/emscripten-core/emscripten/pull/20452 and https://github.com/emscripten-core/emscripten/pull/20513 – newer versions of emscripten will compile workers with { type: 'module' } 🎉