From c5cc044f62156430f3378a2942ba8de3422f1a2b Mon Sep 17 00:00:00 2001 From: getspooky Date: Thu, 16 Sep 2021 15:38:36 +0100 Subject: [PATCH] fix(server): TS2801 [ERROR]: This condition will always return true since this 'Promise' is always defined --- server/aleph.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/aleph.ts b/server/aleph.ts index 6d510397c..85c1416c0 100644 --- a/server/aleph.ts +++ b/server/aleph.ts @@ -938,7 +938,7 @@ export class Aleph implements IAleph { async importModule(module: Module): Promise { const path = join(this.#buildDir, module.jsFile) const hash = this.computeModuleHash(module) - if (existsFile(path)) { + if (await existsFile(path)) { return await import(`file://${path}#${(hash).slice(0, 6)}`) } throw new Error(`import ${module.specifier}: file not found: ${path}`)