From 4b6627fdcd4ded4e40521be84acbb53b486fd259 Mon Sep 17 00:00:00 2001 From: Frank Lemanschik Date: Sat, 23 Apr 2022 06:52:15 +0200 Subject: [PATCH] Fix: tsc did not build (#4471) 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];