From 5b27b333b63b3f49c394a0fd663eab29e21e9e65 Mon Sep 17 00:00:00 2001 From: Frank Lemanschik Date: Fri, 22 Apr 2022 10:38:53 +0200 Subject: [PATCH] Fix: tsc did not build cli/run/loadConfigFile.ts:114:4 - error TS2722: Cannot invoke an object which is possibly 'undefined'. 114 defaultLoader(module, requiredFileName); ~~~~~~~~~~~~~ --- cli/run/loadConfigFile.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/run/loadConfigFile.ts b/cli/run/loadConfigFile.ts index 70addb40dce..946d2d4752b 100644 --- a/cli/run/loadConfigFile.ts +++ b/cli/run/loadConfigFile.ts @@ -111,7 +111,9 @@ async function loadConfigFromBundledFile(fileName: string, bundledCode: string): if (requiredFileName === resolvedFileName) { (module as NodeModuleWithCompile)._compile(bundledCode, requiredFileName); } else { - defaultLoader(module, requiredFileName); + if (defaultLoader) { + defaultLoader(module, requiredFileName); + } } }; delete require.cache[resolvedFileName];