ffmpegwasm / ffmpeg.wasm

FFmpeg for browser, powered by WebAssembly
https://ffmpegwasm.netlify.app
MIT License
13.63k stars 787 forks source link

function(errno){this.errno=errno} could not be cloned. #533

Closed manfwh closed 11 months ago

manfwh commented 11 months ago

Describe the bug

Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'DedicatedWorkerGlobalScope': function(errno){this.errno=errno} could not be cloned.
    at self.onmessage

To Reproduce Steps to reproduce the behavior:

try {
await ffmpeg.exec(['-i', 'invalid_path.avi', 'output.mp4']
} catch(e) {
// can not catch error 
}

Expected behavior get exec error

Desktop (please complete the following information):

Additional context in source code worker.ts 182L, Error object has an property "setErrno", which is a function. Function objects cannot be duplicated by the structured clone algorithm

self.postMessage({ id, type: FFMessageType.ERROR, data: e as Error });