From 20bf8f57e8e8bb62ff1ec0c938b34c141ca65ccf Mon Sep 17 00:00:00 2001 From: Lukas <77849373+qwqtoday@users.noreply.github.com> Date: Sun, 13 Apr 2025 22:59:06 +0800 Subject: [PATCH] simple fix on SharedArrayBuffer is not defined (#7) --- src/lib/engine/shared.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/engine/shared.ts b/src/lib/engine/shared.ts index fc60ad4..1713b47 100644 --- a/src/lib/engine/shared.ts +++ b/src/lib/engine/shared.ts @@ -10,7 +10,13 @@ export const isWasmSupported = () => Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00) ); -export const isMultiThreadSupported = () => SharedArrayBuffer !== undefined; +export const isMultiThreadSupported = () => { + try { + return SharedArrayBuffer !== undefined; + } catch(e) { + return false; + } +}; export const isEngineSupported = (name: EngineName): boolean => { switch (name) {