"TypeError: Cannot destructure property 'build' of 'architect' as it is undefined." when generating Cypress Angular Component test configuration
See original GitHub issueCurrent behavior
I’m attempting to setup Angular component tests by using the Cypress UI tool:
But I’m getting this error:
Any advise would be much appreciated 🙏!
Desired behavior
I’d like the tool to generate working configuration(s) enabling me to test Angular components (/not getting “Unexpecting Error”).
Test code to reproduce
I’m using a clean nx-workspace (Angular/NestJS/Cypress), which can be found here: https://github.com/rujorgensen/nx-workspace
Cypress Version
10.7.0
Node version
16.16.0
Operating System
Windows 11
Debug Logs
No response
Other
Complete outputs:
21 | const defaultProjectConfig = angularJson.projects[defaultProject];
22 | const { architect, root, sourceRoot } = defaultProjectConfig;
> 23 | const { build } = architect;
| ^
24 | return {
25 | root,
26 | sourceRoot,
27 | buildOptions: Object.assign(Object.assign({}, build.options), ((_a = build.configurations) === null || _a === void 0 ? void 0 : _a.development) || {}),
TypeError: Cannot destructure property 'build' of 'architect' as it is undefined.
at getProjectConfig (C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\@packages\server\node_modules\@cypress\webpack-dev-server\dist\helpers\angularHandler.js:23:13)
at async getAngularCliWebpackConfig (C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\@packages\server\node_modules\@cypress\webpack-dev-server\dist\helpers\angularHandler.js:132:117)
at async angularHandler (C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\@packages\server\node_modules\@cypress\webpack-dev-server\dist\helpers\angularHandler.js:141:27)
at async getPreset (C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\@packages\server\node_modules\@cypress\webpack-dev-server\dist\devServer.js:76:20)
at async Function.devServer.create (C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\@packages\server\node_modules\@cypress\webpack-dev-server\dist\devServer.js:93:61)
at async C:\Users\rj\AppData\Local\Cypress\Cache\10.7.0\Cypress\resources\app\node_modules\@packages\server\node_modules\@cypress\webpack-dev-server\dist\devServer.js:25:24
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Cannot destructure property 'build' of 'architect' as it is ... - GitHub
"TypeError: Cannot destructure property 'build' of 'architect' as it is undefined." when generating Cypress Angular Component test configuration #363.
Read more >Failed: Cannot destructure property 'xxx' of 'undefined' as it is ...
I try the first time to write an angular test. Failed: Cannot destructure property 'coding' of 'undefined' as it is undefined. Only where...
Read more >What's New with Cypress Web Testing?
Cypress will throw an error when a user attempts to update a configuration value at run-time using either the Test Configuration or using...
Read more >Testing Web Components with Karma and TypeScript
Imagine yourself building an electric car. By design, this car has an electric motor, a cooling system, a battery, a charge port, ...
Read more >error was thrown in afterall | The AI Search Engine You Control
Angular 6 Unit Tests: An error was thrown in afterAll\nReferenceError: Can't find variable: $ thrown. Asked Jul 26, 2018 • 59 votes 12...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Going to close this issue, we can reopen if we need to make changes on our side to support Nx.
Glad I could help 😃