You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cypress configuration error
Try again
Error
Your configFile is invalid: /home/---/---/---/---/libs/shared/ng-charts/cypress.config.ts
It threw an error when required, check the stack trace below:
../../../node_modules/@nx/angular/plugins/component-testing.js:206:15
204 | // }
205 |if (!options.main) {
> 206 | throw new Error('Missing executor options "main"');| ^
207 | }
208 |if (!options.index) {
209 | throw new Error('Missing executor options "index"');
210 | }
Stack trace
Error: Missing executor options "main"
at withSchemaDefaults (/home/---/---/---/---/node_modules/@nx/angular/plugins/component-testing.js:206:15)
at normalizeBuildTargetOptions (/home/---/---/---/---/node_modules/@nx/angular/plugins/component-testing.js:108:26)
at nxComponentTestingPreset (/home/---/---/---/---/node_modules/@nx/angular/plugins/component-testing.js:58:36)
at Object. (/home/---/---/---/---/libs/shared/ng-charts/cypress.config.ts:5:38)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module.m._compile (/home/---/.cache/Cypress/13.5.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:857:29)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Object.require.extensions. [as .ts] (/home/---/.cache/Cypress/13.5.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:859:16)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Function.Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at loadFile (/home/---/.cache/Cypress/13.5.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:89:14)
at EventEmitter. (/home/---/.cache/Cypress/13.5.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_require_async_child.js:116:38)
at EventEmitter.emit (node:events:514:28)
at EventEmitter.emit (node:domain:488:12)
at process. (/home/---/.cache/Cypress/13.5.1/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)
at process.emit (node:events:514:28)
at process.emit (node:domain:488:12)
at process.emit.sharedData.processEmitHook.installedValue [as emit] (/home/---/.cache/Cypress/13.5.1/Cypress/resources/app/node_modules/@cspotcode/source-map-support/source-map-support.js:745:40)
at emit (node:internal/child_process:951:14)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Package Manager Version
No response
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
As can be seen in the Failure Log above, the withSchemaDefaults method in component-testing.js ignores the options.browser property and only checks for the main property of the provided build options.
A locally working quick-fix is to patch the value of options.browser prop to options.main before checking the existence of options.main:
...
function withSchemaDefaults(options) {
if (options.browser) {
options.main = options.browser;
}
if (!options.main) {
throw new Error('Missing executor options "main"');
}
...
The text was updated successfully, but these errors were encountered:
Current Behavior
Running a component test for an angular project using latest (17.1.2) nx fails with error 'Missing executor options "main"'.
Expected Behavior
Component test can be started
GitHub Repo
No response
Steps to Reproduce
nx @nx/angular:application
nx g @nx/angular:library
nx @nx/angular:zypress-componet-configuration
referencing the build configuration of the appnx component-test
for lib using the--watch
flagNx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
As can be seen in the Failure Log above, the withSchemaDefaults method in
component-testing.js
ignores theoptions.browser
property and only checks for themain
property of the provided build options.A locally working quick-fix is to patch the value of
options.browser
prop tooptions.main
before checking the existence ofoptions.main
:The text was updated successfully, but these errors were encountered: