diff --git a/packages/nx/src/nx-cloud/update-manager.ts b/packages/nx/src/nx-cloud/update-manager.ts index e81c3c7c702956..a2bd3b698861e3 100644 --- a/packages/nx/src/nx-cloud/update-manager.ts +++ b/packages/nx/src/nx-cloud/update-manager.ts @@ -56,7 +56,7 @@ export interface NxCloudClient { configureLightClientRequire: () => (paths: string[]) => void; commands: Record Promise>; nxCloudTasksRunner: TasksRunner; - remoteCache: RemoteCacheV2; + remoteCache: () => RemoteCacheV2; } export async function verifyOrUpdateNxCloudClient( options: CloudTaskRunnerOptions diff --git a/packages/nx/src/tasks-runner/cache.ts b/packages/nx/src/tasks-runner/cache.ts index dc05a3a9fee84b..39da35316190a1 100644 --- a/packages/nx/src/tasks-runner/cache.ts +++ b/packages/nx/src/tasks-runner/cache.ts @@ -120,7 +120,7 @@ export class DbCache { const options = getCloudOptions(); const { nxCloudClient } = await verifyOrUpdateNxCloudClient(options); if (nxCloudClient.remoteCache) { - return nxCloudClient.remoteCache; + return nxCloudClient.remoteCache(); } else { // old nx cloud instance return await RemoteCacheV2.fromCacheV1(this.options.nxCloudRemoteCache);