libheif-js icon indicating copy to clipboard operation
libheif-js copied to clipboard

how to fix "WebAssembly.Compile is disallowed on the main thread, if the buffer size is larger than 4KB. Use WebAssembly.compile, or compile on a worker thread."

Open zhangbowy opened this issue 1 year ago • 3 comments

image

const convert = require("heic-convert/browser");
const conversionResult = await convert({
  buffer: buffer, // the HEIC file buffer
  format: "JPEG", // output format
  quality: 1 // the jpeg compression quality, between 0 and 1
});

window10, chrome95

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36

zhangbowy avatar Oct 30 '24 03:10 zhangbowy

I haven't run into this error. Do you have a minimal reproduction for this?

Also, Chrome 95 is 3 years old (current is 130), does this occur on a more recent browser?

catdad avatar Oct 30 '24 05:10 catdad

@catdad We are running into this as well, also on slightly older browsers. Do you have explicit browsers that this package is intended to support?

goodallt avatar Dec 12 '24 21:12 goodallt

Same here — I ran into this error on Samsung Internet 22.0 and 24.0 as well. I'm on version 1.18.2.

AliRezaQavidel avatar Apr 16 '25 08:04 AliRezaQavidel