From 684d2a9bbef628e0fe84667e2d274177a788623a Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Tue, 23 Jul 2024 14:40:47 -0500 Subject: [PATCH] fix(core): fix watch daemon error (#27067) ## Current Behavior `nx watch` throws an error saying the daemon is not running when the daemon is indeed running. ## Expected Behavior `nx watch` does not throw an error saying the daemon is not running when the daemon is indeed running. ## Related Issue(s) Fixes # --- e2e/nx/src/watch.test.ts | 1 + packages/nx/src/command-line/watch/watch.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/e2e/nx/src/watch.test.ts b/e2e/nx/src/watch.test.ts index 5b863a6c5521c..bf97e6ce6ca5f 100644 --- a/e2e/nx/src/watch.test.ts +++ b/e2e/nx/src/watch.test.ts @@ -174,6 +174,7 @@ async function runWatch(command: string) { CI: 'true', ...getStrippedEnvironmentVariables(), FORCE_COLOR: 'false', + NX_DAEMON: 'true', }, shell: true, stdio: 'pipe', diff --git a/packages/nx/src/command-line/watch/watch.ts b/packages/nx/src/command-line/watch/watch.ts index 73c6d7440f235..5b673b48df9d0 100644 --- a/packages/nx/src/command-line/watch/watch.ts +++ b/packages/nx/src/command-line/watch/watch.ts @@ -159,7 +159,7 @@ export async function watch(args: WatchArguments) { process.env.NX_VERBOSE_LOGGING = 'true'; } - if (daemonClient.enabled()) { + if (!daemonClient.enabled()) { output.error({ title: 'Daemon is not running. The watch command is not supported without the Nx Daemon.',