92 questions
3
votes
1
answer
160
views
Do methods on the ECMAScript Atomics object enforce that all prior shared memory operations are completed first?
The ECMAScript Language Specification states:
Atomics are carved in stone: Program transformations must not cause any Shared Data Block events whose [[Order]] is seq-cst to be removed from the is-...
2
votes
2
answers
218
views
Type narrowing of Uint8Array<ArrayBufferLike> to Uint8Array<ArrayBuffer>
Since TypeScript 5.9 we have (roughly speaking) Uint8Array = Uint8Array<ArrayBufferLike> = Uint8Array<ArrayBuffer | SharedArrayBuffer>. Now I am looking for a clean and idiomatic way to ...
2
votes
0
answers
49
views
How to share a single WebAssembly.Memory instance between multiple ESM worker threads in Node.js 22?
I am working with Node.js 22 using native ESM and Worker Threads, I'm trying to share a single WebAssembly.Memory instance across multiple workers to avoid duplicating memory.
// main.mjs
import { ...
4
votes
1
answer
175
views
How is this seemingly airtight synchronous SharedArrayBuffer setup manifesting corruption?
I have a setup where I have a couple dozen web workers postMessage requests to the main thread and then synchronously block for the response:
Since this is synchronous, the web worker never makes a ...
1
vote
2
answers
224
views
What results in TextEncoder.encode() using a buffer of a given type?
The return value of TextEncoder.encode() is Uint8Array<ArrayBufferLike>. The ArrayBufferLike type includes ArrayBuffer and SharedArrayBuffer. How to know which type of array buffer encode() will ...
0
votes
1
answer
179
views
Visibility of data in shared array buffer after using postMessage() with web worker
I am using a web worker to process some data for me. The flow goes like this: main thread writes to a shared array buffer, then once done writing, uses postMessage to send the buffer to the webworker. ...
0
votes
1
answer
559
views
Error loading FFmpeg: ReferenceError: SharedArrayBuffer is not defined - Angular 18.2.3
Question:
I am working on an Angular project (version 18.2.3) where I use ffmpeg.wasm to trim videos and extract frames. However, when trying to load FFmpeg, I am encountering the following error in ...
0
votes
0
answers
549
views
RangeError: Array buffer allocation failed after multiple page refreshes despite sufficient memory
I'm encountering a RangeError: Array buffer allocation failed error in my JavaScript application after refreshing the page multiple times. The error occurs even though the memory usage appears to be ...
1
vote
1
answer
329
views
How to used SharedArrayBuffer in iframe without iframe unsandboxing itself
I want to allow a sandboxed iframe to use SharedArrayBuffer with web workers created by the iframe. To use SharedArrayBuffer I have to set the following headers
Cross-Origin-Opener-Policy: same-origin
...
-1
votes
1
answer
513
views
Cross origin isolation and SharedArrayBuffer issue in godot4 game on iframe load
I have built a game using godot4 and hosted it on a Linux server.
In-game server .htacess
Header set Cross-Origin-Opener-Policy: "same-origin"
Header set Cross-Origin-Resource-Policy "...
-1
votes
1
answer
448
views
Shared Array Buffer in firebase using CORS headers
I am setting up a Firebase Web App and am unsure how to setup CORS headers for SharedArrayBuffer and if there is anything else I need to do for the SharedArrayBuffer. You can check the website if you ...
0
votes
1
answer
56
views
Sharing a TypedArray view of a SharedArrayBuffer with a worker - is the full SharedArrayBuffer accessible?
If I create a SharedArrayBuffer, and then create a 'view' of said buffer via a TypedArray, and then send that TypedArray to a Worker via postMessage, is the worker able to access the full data of the ...
2
votes
1
answer
811
views
Trouble with Cross-Origin Headers: Stripe and ffmpeg Integration in Next.js
I'm using this excellent template from vercel as a base for my project :
https://vercel.com/templates/next.js/subscription-starter
I've used it for many projects and the Stripe integration works ...
1
vote
0
answers
417
views
Google oauth button issue with COOP
The issue is: since i locked my page up in order to use sharedArrayBuffer (and other perks) google auth throws an error at posting a message between windows:
m=credential_page_library:210 Uncaught ...
1
vote
0
answers
1k
views
Setting Cross-origin-Embedder-Policy and Cross-origin-Opener-Policy headers in Express
I've been developing a website using Express for the backend and React for the frontend. I've come across the issue where my application won't work on Firefox due to this error: 'ReferenceError: ...