vue-app icon indicating copy to clipboard operation
vue-app copied to clipboard

crash createFFmpeg.js:64

Open iollllllloi opened this issue 4 years ago • 8 comments

Uncaught (in promise) ReferenceError: SharedArrayBuffer is not defined createFFmpegCore 5aa0d9cb-82b7-b843-95f8-5e7cf39ad9f7:22 load createFFmpeg.js:64

iollllllloi avatar Dec 15 '20 08:12 iollllllloi

What browser are you using? https://caniuse.com/sharedarraybuffer

raldur avatar Jan 05 '21 14:01 raldur

What browser are you using? https://caniuse.com/sharedarraybuffer

Firefox – which has disabled SharedArrayBuffer as of January 2018 to mitigate Meltdown/Spectre.

caugner avatar Feb 02 '21 12:02 caugner

ReferenceError: SharedArrayBuffer is not defined
    at 62450249-9a80-449e-a7a6-6435f7577039:22
    at Object.x [as load] (createFFmpeg.js:64)
    at async Proxy.c (App.vue:29)

I just tried the demo on https://ffmpegwasm.github.io/vue-app/

Using Chrome Version 92.0.4515.107 64 bits

jaronwanderley avatar Jul 28 '21 23:07 jaronwanderley

@jaronwanderley Is is still not working ?

I have no issue and I can't reproduce the bug.

julienbeisel avatar Aug 03 '21 15:08 julienbeisel

@jaronwanderley Is is still not working ?

Yep, still there on https://ffmpegwasm.github.io/vue-app/ : Linux chrome Version 92.0.4515.131 64 bits:

[Deprecation] SharedArrayBuffer will require cross-origin isolation as of M92, around July 2021. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details.

x @ createFFmpeg.js:64
async function (async)
x @ createFFmpeg.js:63
c @ App.vue:30
Object.onClick.t.<computed>.t.<computed> @ App.vue:7
Le @ runtime-core.esm-bundler.js:155
Me @ runtime-core.esm-bundler.js:164
n @ runtime-dom.esm-bundler.js:349
runtime-core.esm-bundler.js:226 ReferenceError: SharedArrayBuffer is not defined
    at e3d605f2-60a3-4eb9-9699-4aa599feb999:22
    at Object.x [as load] (createFFmpeg.js:64)
    at async Proxy.c (App.vue:29)

Windows Chrome Version 92.0.4515.131 32 bits:

RangeError: WebAssembly.Memory(): could not allocate memory
    at 671cddf1-1344-4e5b-9638-b3ec5eb11386:22
    at Object.x [as load] (createFFmpeg.js:64)
    at async Proxy.c (App.vue:29)

jaronwanderley avatar Aug 03 '21 16:08 jaronwanderley

You can try that on Linux :

  • Quit any running instance of Chrome.
  • Run your favorite terminal emulator.
  • In the terminal, run commands like below
google-chrome --enable-features=SharedArrayBuffer

source (with mac & windows instructions as well) : https://web.dev/cross-origin-isolation-guide/

Ideally you'd have to set HTTP headers for cross origin isolation, my solution is just a fix for local development.

julienbeisel avatar Aug 03 '21 16:08 julienbeisel

Adding cross origin headers to the vue.config.js fixed this for me locally

const path = require('path');
const express = require('express');

module.exports = {
  publicPath: process.env.NODE_ENV === 'production'
    ? '/vue-app/'
    : '/',
  configureWebpack: {
    devServer: {
      before: app => {
        app.use('/node_modules/', express.static(path.resolve(__dirname, 'node_modules')))
      },
      headers: { "Cross-Origin-Embedder-Policy" : "require-corp",
                  "Cross-Origin-Opener-Policy" : "same-origin" }
    }
  }
};

cclaan avatar Aug 29 '21 01:08 cclaan

Is it only possible to make that work by setting the require-corp and same-origin headers?

BrunoQuaresma avatar Oct 06 '21 23:10 BrunoQuaresma