Describe the bug
Essentially every UUID constructor throws ReferenceError: SharedArrayBuffer is not defined on non-cross-origin-isolated pages
In @surrealdb/sqon (Uuid constructor), the line if (uuid instanceof ArrayBuffer || uuid instanceof SharedArrayBuffer) references SharedArrayBuffer unguarded. On any page that isn't cross-origin isolated, that global doesn't exist, and evaluating the instanceof right-hand operand throws a ReferenceError before any comparison happens. This essentially means that every client-side Uuid construction throws.
Fix is a one-token guard: typeof SharedArrayBuffer !== 'undefined' && uuid instanceof SharedArrayBuffer.
Steps to reproduce
Try to create any UUID on the client on non-cross-origin-isolated pages.
Expected behaviour
UUID creation works
SurrealDB version
3.1.5 for macos on aarch64
JavaScript SDK version
2.0.4
Contact Details
No response
Is there an existing issue for this?
Code of Conduct (repository /surrealdb.js)
Describe the bug
Essentially every UUID constructor throws
ReferenceError: SharedArrayBuffer is not definedon non-cross-origin-isolated pagesIn @surrealdb/sqon (Uuid constructor), the line
if (uuid instanceof ArrayBuffer || uuid instanceof SharedArrayBuffer)references SharedArrayBuffer unguarded. On any page that isn't cross-origin isolated, that global doesn't exist, and evaluating the instanceof right-hand operand throws a ReferenceError before any comparison happens. This essentially means that every client-side Uuid construction throws.Fix is a one-token guard: typeof SharedArrayBuffer !== 'undefined' && uuid instanceof SharedArrayBuffer.
Steps to reproduce
Try to create any UUID on the client on non-cross-origin-isolated pages.
Expected behaviour
UUID creation works
SurrealDB version
3.1.5 for macos on aarch64
JavaScript SDK version
2.0.4
Contact Details
No response
Is there an existing issue for this?
Code of Conduct (repository /surrealdb.js)