nx icon indicating copy to clipboard operation
nx copied to clipboard

"Cypress configuration error" when running Cypress Angular Component test configuration on Windows

Open rujorgensen opened this issue 2 years ago • 0 comments

Current Behavior

I'm attempting to setup Angular component tests by using the NRWL generator nx g @nrwl/angular:cypress-component-configuration, but I'm getting this error when trying to run nx component-test angular-app --watch the issue appears to only be on my Windows 10/11 machines, it works as expected on Linux (and reportedly on Mac):

190854107-a6e4376b-c4b1-4e1b-a857-4d5016ecf21f

(I originally reported the issue to Cypress https://github.com/cypress-io/cypress/issues/23841)

Expected Behavior

I'd like the tool to generate working configuration(s) enabling me to test Angular components (/not getting "Cypress configuration error").

Steps to Reproduce

I'm using a clean nx-workspace (Angular/NestJS/Cypress), which can be found on this branch: github, then using nx component-test angular-app --watch on Windows 10 or 11.

Failure Logs

Complete output

Found project name? undefined.
Graph has data? false
    at getProjectConfigByPath (C:\Users\rj\Desktop\nx-workspace\packages\cypress\plugins\cypress-preset.ts:97:11)
    at nxComponentTestingPreset (C:\Users\rj\Desktop\nx-workspace\packages\angular\plugins\component-testing.ts:64:49)
    at Object. (C:\Users\rj\Desktop\nx-workspace\apps\angular-app\cypress.config.ts:5:40)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module.m._compile (C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\ts-node\src\index.ts:1455:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Object.require.extensions. [as .ts] (C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\ts-node\src\index.ts:1458:12)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at loadFile (C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\run_require_async_child.js:89:14)
    at EventEmitter. (C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\run_require_async_child.js:116:38)
    at EventEmitter.emit (node:events:527:28)
    at EventEmitter.emit (node:domain:475:12)
    at process. (C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\@packages\server\lib\plugins\util.js:33:22)
    at process.emit (node:events:527:28)
    at process.emit (node:domain:475:12)
    at process.emit.sharedData.processEmitHook.installedValue [as emit] (C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\@cspotcode\source-map-support\source-map-support.js:613:40)
    at emit (node:internal/child_process:938:14)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)

Environment

NX Version 14.7.5

Cypress Version 10.7.0

Node version 16.16.0

Operating System Windows 10 and 11

rujorgensen avatar Sep 19 '22 16:09 rujorgensen