From 4f67552bf3917ab053f31cad954ef63c83353437 Mon Sep 17 00:00:00 2001 From: Craigory Coppola Date: Tue, 11 Apr 2023 11:38:58 -0400 Subject: [PATCH] fix(core): deleted projects should not be in cached graph (#16210) (cherry picked from commit 1df2d68d6debc0ea4602018013f1ee5ca1028808) --- packages/nx/src/project-graph/build-project-graph.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nx/src/project-graph/build-project-graph.ts b/packages/nx/src/project-graph/build-project-graph.ts index fc975f24cccfa..75471cc04ae09 100644 --- a/packages/nx/src/project-graph/build-project-graph.ts +++ b/packages/nx/src/project-graph/build-project-graph.ts @@ -75,7 +75,7 @@ export async function buildProjectGraphUsingProjectFileMap( let filesToProcess; let cachedFileData; - if ( + const useCacheData = cache && !shouldRecomputeWholeGraph( cache, @@ -83,8 +83,8 @@ export async function buildProjectGraphUsingProjectFileMap( projectsConfigurations, nxJson, rootTsConfig - ) - ) { + ); + if (useCacheData) { const fromCache = extractCachedFileData(projectFileMap, cache); filesToProcess = fromCache.filesToProcess; cachedFileData = fromCache.cachedFileData; @@ -104,7 +104,7 @@ export async function buildProjectGraphUsingProjectFileMap( context, cachedFileData, projectGraphVersion, - cache + useCacheData ? cache : null ); const projectGraphCache = createCache( nxJson,