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(); }; + +