From 80e6edd707a007ca8405bd20c3b8a6c40b1cf887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Fri, 2 May 2025 12:43:03 +0200 Subject: [PATCH] fix(testing): use correct server process reference when killing the server in the cypress preset (#30994) ## Current Behavior Cypress e2e tasks fail when trying to kill the web server with: ```bash TypeError: Cannot read properties of undefined (reading 'childProcess') at //node_modules/@nx/cypress/plugins/cypress-preset.js:65:30 ... ``` ## Expected Behavior Cypress e2e tasks should not fail when trying to kill the web server. ## Related Issue(s) Fixes # --- packages/cypress/plugins/cypress-preset.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cypress/plugins/cypress-preset.ts b/packages/cypress/plugins/cypress-preset.ts index 0d163985d7..d25623b43e 100644 --- a/packages/cypress/plugins/cypress-preset.ts +++ b/packages/cypress/plugins/cypress-preset.ts @@ -94,7 +94,7 @@ function startWebServer(webServerCommand: string) { } else { return new Promise((res, rej) => { if (process.platform === 'win32' || process.platform === 'darwin') { - if (this.childProcess.kill()) { + if (serverProcess.kill()) { res(); } else { rej('Unable to kill process');