From 7afa8141b742069eb1e66f6dbc0da890a0c57d73 Mon Sep 17 00:00:00 2001 From: Jack Zhao Date: Tue, 19 Sep 2023 03:56:36 +0000 Subject: [PATCH] worker doc error --- docs/src/components/PySandboxExample.astro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/src/components/PySandboxExample.astro b/docs/src/components/PySandboxExample.astro index 2e83c7d..04fb5aa 100644 --- a/docs/src/components/PySandboxExample.astro +++ b/docs/src/components/PySandboxExample.astro @@ -45,6 +45,9 @@ const { code, target, worker, restricted } = Astro.props; let sandbox; try { if (this.dataset.worker) { + if (typeof SharedArrayBuffer === "undefined") { + throw new Error("Unable to use SharedArrayBuffer due insecure environment."); + } sandbox = await getWorkerSandbox({ restricted: this.dataset.restricted, });