From fedcfc4725d4df1d9e1741d54a35c65f02b0be99 Mon Sep 17 00:00:00 2001 From: James Henry Date: Fri, 23 Jul 2021 13:29:24 +0400 Subject: [PATCH] fix(core): ensure cache pathMappings always exist --- packages/workspace/src/core/nx-deps/nx-deps-cache.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/workspace/src/core/nx-deps/nx-deps-cache.ts b/packages/workspace/src/core/nx-deps/nx-deps-cache.ts index 02047d7e57..af823af5fe 100644 --- a/packages/workspace/src/core/nx-deps/nx-deps-cache.ts +++ b/packages/workspace/src/core/nx-deps/nx-deps-cache.ts @@ -83,7 +83,7 @@ export function readCache(): false | ProjectGraphCache { export function writeCache( packageJsonDeps: Record, nxJson: NxJsonConfiguration, - tsConfig: { compilerOptions: { paths: { [k: string]: any } } }, + tsConfig: { compilerOptions: { paths?: { [k: string]: any } } }, projectGraph: ProjectGraph ): void { performance.mark('write cache:start'); @@ -94,7 +94,7 @@ export function writeCache( const newValue: ProjectGraphCache = { version: '3.0', deps: packageJsonDeps, - pathMappings: tsConfig.compilerOptions.paths, + pathMappings: tsConfig.compilerOptions.paths || {}, nxJsonPlugins, nodes: projectGraph.nodes, dependencies: projectGraph.dependencies,