From db8ade81b147571d00bf0822b543575ba2f314e0 Mon Sep 17 00:00:00 2001 From: Peter van Vliet Date: Mon, 17 Apr 2023 09:22:35 +0200 Subject: [PATCH] #250: Fixed importing modules --- packages/runtime/src/hooks/dependencies.ts | 2 +- packages/runtime/src/services/LocalNode.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime/src/hooks/dependencies.ts b/packages/runtime/src/hooks/dependencies.ts index 3f44785c..94e72104 100644 --- a/packages/runtime/src/hooks/dependencies.ts +++ b/packages/runtime/src/hooks/dependencies.ts @@ -4,7 +4,7 @@ import ModuleLoader from '../utils/ModuleLoader.js'; -let _loader: Function = ModuleLoader.import; +let _loader: Function = (name: string) => ModuleLoader.import(name); export function setDependencyLoader(loader: Function): void { diff --git a/packages/runtime/src/services/LocalNode.ts b/packages/runtime/src/services/LocalNode.ts index 441168df..55377c30 100644 --- a/packages/runtime/src/services/LocalNode.ts +++ b/packages/runtime/src/services/LocalNode.ts @@ -100,7 +100,7 @@ export default class LocalNode extends Node this.#clientId = await repository.registerClient(segmentNames); setRuntime(this); - setDependencyLoader(ModuleLoader.import); + setDependencyLoader((name: string) => ModuleLoader.import(name)); const moduleLocation = await repository.getModuleLocation(this.#clientId);