From 78260444eb9f85f7a1bab6136036c7a2f18aa29d Mon Sep 17 00:00:00 2001 From: Yohe-Am <56622350+Yohe-Am@users.noreply.github.com> Date: Mon, 16 Dec 2024 12:40:33 +0300 Subject: [PATCH] fix: artifact url bug with deno hook --- src/typegate/src/runtimes/deno/hooks/worker.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/typegate/src/runtimes/deno/hooks/worker.ts b/src/typegate/src/runtimes/deno/hooks/worker.ts index b660c7d45..a0340b803 100644 --- a/src/typegate/src/runtimes/deno/hooks/worker.ts +++ b/src/typegate/src/runtimes/deno/hooks/worker.ts @@ -1,9 +1,11 @@ // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. // SPDX-License-Identifier: MPL-2.0 +import { toFileUrl } from "@std/path/to-file-url"; + self.onmessage = async ({ data }: MessageEvent<{ import: string }>) => { try { - await import(data.import); + await import(toFileUrl(data.import).toString()); self.postMessage({ success: true }); } catch (error) { self.postMessage({ error }); @@ -11,3 +13,5 @@ self.onmessage = async ({ data }: MessageEvent<{ import: string }>) => { self.close(); }; + +