ffmpeg.wasm icon indicating copy to clipboard operation
ffmpeg.wasm copied to clipboard

RuntimeError: abort(LinkError: WebAssembly.instantiate(): Import #258 module="a" function="Rd" error: function import requires a callable)

Open willywwang opened this issue 3 years ago • 2 comments

Describe the bug Approximately 50% of the time we run into this issue in the console which prevents ffmpeg wasm from running.

Uncaught (in promise) RuntimeError: abort(LinkError: WebAssembly.instantiate(): Import #258 module="a" function="Rd" error: function import requires a callable). Build with -s ASSERTIONS=1 for more info.

image

We are using version 0.9.7 of @ffmpeg/ffmpeg.

How we are instantiating ffmpeg:

  const ffmpeg = createFFmpeg({ 
    log: false,   
    corePath: 'https://unpkg.com/@ffmpeg/[email protected]/dist/ffmpeg-core.js', 
  });

Note this issue did not occur before chrome implemented cross origin isolation requiring headers.

Things we have tried:

  1. Updating to latest versions of @ffmpeg/ffmpeg + ffmpeg/core
  2. Setting the core path manually

This issue does not occur when:

We remove Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp headers, and launch chrome with flag to enable SharedBufferArray (but we can't really tell users of our app to run chrome with this flag on every time).

willywwang avatar Jan 25 '22 16:01 willywwang

I am facing same issue. Was there any solution that worked for you?

Gyans93 avatar Sep 02 '23 23:09 Gyans93

@Gyans93 unfortunately no solution was found, so we hosted our own ffmpeg solution using AWS lambda and calling it from there

willywwang avatar Sep 03 '23 00:09 willywwang