From 6bcc6fbfbfaf8c6d5cb7548f7854a7b84d5fff01 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 22 Nov 2024 18:37:02 -0500 Subject: [PATCH] fix: ensure Deno 2.0 instantiates local files streaming (#147) --- lib/wasmbuild.generated.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/wasmbuild.generated.js b/lib/wasmbuild.generated.js index 43578c6..14c04eb 100644 --- a/lib/wasmbuild.generated.js +++ b/lib/wasmbuild.generated.js @@ -295,7 +295,9 @@ class WasmBuildLoader { const isFile = url.protocol === "file:"; // make file urls work in Node via dnt - const isNode = globalThis.process?.versions?.node != null; + const isNode = globalThis.Deno == null + && globalThis.process?.versions?.node != null + && globalThis.Buffer != null; if (isFile && typeof Deno !== "object") { throw new Error( "Loading local files are not supported in this environment",