How could I make the HTML support SharedArrayBuffer?

I follow instruction from Cloudflare tutorial-- Deploy your site, connect Cloudflare with a github project(that project is written by Qt for webassembly, works well on local pc), and setup the CORS header as the header tutorial of Cloudflare mentioned, but the browser(chrome and firefox) still give me the error message “Application exit (ReferenceError: SharedArrayBuffer is not defined)”.

The header I add is

/*
  Access-Control-Allow-Origin: *

How could I make it support SharedArrayBuffer? Thanks

PS : I cannot add link at here

Not sure how to make it support SharedArrayBuffer from Cloudflare yet, but I find out netlify just work.

Found a similar issue ReferenceError: SharedArrayBuffer is not defined · Issue #263 · ffmpegwasm/ffmpeg.wasm · GitHub

Which mentions this:

with Cross-Origin-Embedder-Policy: require-corp and Cross-Origin-Opener-Policy: same-origin headers

Can you try adding those headers as well?

So like:

/*
  Access-Control-Allow-Origin: *
  Cross-Origin-Embedder-Policy: require-corp
  Cross-Origin-Opener-Policy: same-origin

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.