question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Cannot find configuration for task' error when building Angular 13 app in NX13 workspace with --preserveAngularCLILayout flag set

See original GitHub issue

Current Behavior

We have an Angular application with NX workspace initialised via ng add @nrwl/workspace --preserveAngularCLILayout command that is no longer compiling after updating to v13 of Angular and NX packages via either ng build or nx build.

Expected Behavior

Usually the Angular app compiles without errors. This has regressed since we updated Angular and and NX packages to 13.x last week.

Steps to Reproduce

Run these commands in a terminal to reproduce the error. I have also created a repo where you can install the dependencies and try to build with either ng build or nx build. You should see the same error.

npx ng new < create a new Angular app (installs 13.0.0 as of today) ng build < build works ng add @nrwl/workspace --preserveAngularCLILayout< adds NX workspace nx build< build fails

Repro

Failure Logs

ng build

Error: Cannot find configuration for task test:build at getExecutorNameForTask (C:\Users\dbeazer\Downloads\test\node_modules@nrwl\workspace\src\tasks-runner\utils.js:127:15) at getExecutorForTask (C:\Users\dbeazer\Downloads\test\node_modules@nrwl\workspace\src\tasks-runner\utils.js:133:22) at getCustomHasher (C:\Users\dbeazer\Downloads\test\node_modules@nrwl\workspace\src\tasks-runner\utils.js:140:25) at TasksSchedule.<anonymous> (C:\Users\dbeazer\Downloads\test\node_modules@nrwl\workspace\src\tasks-runner\tasks-schedule.js:114:62) at Generator.next (<anonymous>) at C:\Users\dbeazer\Downloads\test\node_modules\tslib\tslib.js:117:75 at new Promise (<anonymous>) at __awaiter (C:\Users\dbeazer\Downloads\test\node_modules\tslib\tslib.js:113:16) at TasksSchedule.hashTask (C:\Users\dbeazer\Downloads\test\node_modules@nrwl\workspace\src\tasks-runner\tasks-schedule.js:113:38) at TasksSchedule.<anonymous> (C:\Users\dbeazer\Downloads\test\node_modules@nrwl\workspace\src\tasks-runner\tasks-schedule.js:58:24) Unexpected error: Error: Unable to load hasher for task “test:build:production” at getCustomHasher (C:\Users\dbeazer\Downloads\test\node_modules@nrwl\workspace\src\tasks-runner\utils.js:145:15) at TasksSchedule.<anonymous> (C:\Users\dbeazer\Downloads\test\node_modules@nrwl\workspace\src\tasks-runner\tasks-schedule.js:114:62) at Generator.next (<anonymous>) at C:\Users\dbeazer\Downloads\test\node_modules\tslib\tslib.js:117:75 at new Promise (<anonymous>) at __awaiter (C:\Users\dbeazer\Downloads\test\node_modules\tslib\tslib.js:113:16) at TasksSchedule.hashTask (C:\Users\dbeazer\Downloads\test\node_modules@nrwl\workspace\src\tasks-runner\tasks-schedule.js:113:38) at TasksSchedule.<anonymous> (C:\Users\dbeazer\Downloads\test\node_modules@nrwl\workspace\src\tasks-runner\tasks-schedule.js:58:24) at Generator.next (<anonymous>) at C:\Users\dbeazer\Downloads\test\node_modules\tslib\tslib.js:117:75

Environment

Node : 14.17.3 OS : darwin x64 npm : 8.1.2

nx : 13.4.3 @nrwl/angular : undefined @nrwl/cli : 13.4.3 @nrwl/cypress : undefined @nrwl/devkit : 13.4.3 @nrwl/eslint-plugin-nx : undefined @nrwl/express : undefined @nrwl/jest : 13.4.3 @nrwl/linter : 13.4.3 @nrwl/nest : undefined @nrwl/next : undefined @nrwl/node : undefined @nrwl/nx-cloud : undefined @nrwl/react : undefined @nrwl/react-native : undefined @nrwl/schematics : undefined @nrwl/tao : 13.4.3 @nrwl/web : undefined @nrwl/workspace : 13.4.3 @nrwl/storybook : undefined @nrwl/gatsby : undefined typescript : 4.4.4 rxjs : 7.4.0

Community plugins: @angular/animations: 13.0.3 @angular/common: 13.0.3 @angular/compiler: 13.0.3 @angular/core: 13.0.3 @angular/forms: 13.0.3 @angular/platform-browser: 13.0.3 @angular/platform-browser-dynamic: 13.0.3 @angular/router: 13.0.3 @angular-devkit/build-angular: 13.0.4 @angular/cli: 13.0.4 @angular/compiler-cli: 13.0.3

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
adamstretcommented, Aug 29, 2022

Yup, same here.

2reactions
tencho12commented, Aug 6, 2022

still not able to build

Read more comments on GitHub >

github_iconTop Results From Across the Web

Project Configuration - Nx
Projects can be configured in package.json (if you use npm scripts and not Nx executors) ... Nx merges the two files to get...
Read more >
Cannot find module 'nx/src/config/workspaces' on creating a ...
Cannot find module 'nx/src/config/workspaces' on creating a React app on ... I am getting the following error and I add the react app...
Read more >
Nx v14 is out — Here is all you need to know!
A lot happened since we released Nx version 13 back in October 2021. ... to have Nx Cloud installed in the workspace (although...
Read more >
Getting Started with Monorepo with Nx Nrwl - Rupesh Tiwari
In this article, I will walk you through the steps to create one nx monorepo workspace with Angular application and libraries from empty ......
Read more >
nx cannot read properties of undefined (reading 'endswith')
So I set @angular/cli to version 14.2.1 and @nrwl/cli to 14.6.4. ... Script name: postinstall NX As of Nx 13, project configuration should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found