React App Example Throws Error (SharedArrayBuffer is not defined)
See original GitHub issueDescribe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- Clone the repo
- Install dependencies (yarn)
- Run app (yarn start)
- Open http://localhost:300
- Click “Start”
- You will see an error like:
Unhandled Rejection (ReferenceError): SharedArrayBuffer is not defined
▶ 2 stack frames were collapsed.
async doTranscode
src/App.js:13
10 | });
11 | const doTranscode = async () => {
12 | setMessage('Loading ffmpeg-core.js');
> 13 | await ffmpeg.load();
| ^ 14 | setMessage('Start transcoding');
15 | ffmpeg.FS('writeFile', 'test.avi', await fetchFile('/flame.avi'));
16 | await ffmpeg.run('-i', 'test.avi', 'test.mp4');
View compiled
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error. Click the 'X' or hit ESC to dismiss this message.
Expected behavior Of course, the demo working fresh from an install to work.
Screenshots
Desktop (please complete the following information):
- OS: macOS 11.4
- Browser Chrome
- Version 92.0.4515.131 (Official Build) (x86_64)
Issue Analytics
- State:
- Created 2 years ago
- Comments:13
Top Results From Across the Web
ReferenceError: SharedArrayBuffer is not defined · Issue #3
Bow I am getting another error: Error: ffmpeg.wasm is not ready, make sure you have completed load(). Wonder if his has something to...
Read more >React Error: "SharedArrayBuffer is not defined" in Firefox
I have a React app, created with ' ...
Read more >React Error: "SharedArrayBuffer is not defined" in Firefox ...
Coding example for the question React Error: "SharedArrayBuffer is not defined" in Firefox-Reactjs.
Read more >How to fix SharedArrayBuffer is not defined error - TechKBlog
Came across this "SharedArrayBuffer is not defined" error in Firefox browser, while working on a react app of mine. This is how I...
Read more >SharedArrayBuffer - JavaScript - MDN Web Docs
With these two headers set, postMessage() no longer throws for SharedArrayBuffer objects and shared memory across threads is therefore ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
--enable-features=SharedArrayBuffer
is no longer supported, you have to add the meta tag<meta http-equiv="origin-trial" content="token">
to yourindex.html
header. You can get your token from hereProtip to future explorers. Here’s how you enable sharedbuffers when developing on localhost.
Enabling cross-origin isolation on a local server might be a pain as simple servers do not support sending headers. You can launch Chrome with a command line flag --enable-features=SharedArrayBuffer to enable SharedArrayBuffer without enabling cross-origin isolation. Learn: how to run Chrome with a command line flag on respective platforms.