diff --git a/libraries/rush-lib/src/logic/installManager/WorkspaceInstallManager.ts b/libraries/rush-lib/src/logic/installManager/WorkspaceInstallManager.ts index 97b1cf4c5d..b7e0b53b6b 100644 --- a/libraries/rush-lib/src/logic/installManager/WorkspaceInstallManager.ts +++ b/libraries/rush-lib/src/logic/installManager/WorkspaceInstallManager.ts @@ -228,9 +228,9 @@ export class WorkspaceInstallManager extends BaseInstallManager { // If we enable disableCrossSubspaceChecking, it will only check dependencies within the subspace. if (this.rushConfiguration.experimentsConfiguration.configuration.disableCrossSubspaceChecking) { - referencedLocalProject = subspace - .getProjects() - .filter((project) => project.packageName === name)[0]; + if (referencedLocalProject && subspace.contains(referencedLocalProject)) { + referencedLocalProject = undefined; + } } // Validate that local projects are referenced with workspace notation. If not, and it is not a