nx: @nrwl/workspace upgrade from 15.6.3 to 15.7.0 breaks Angular build - Unable to read angular.json

Current Behavior

Exception raised causing the build to fail.

Expected Behavior

Normal Angular build

GitHub Repo

No response

Steps to Reproduce

Unable to provide an example repo or further steps at this time. I tried using the nx_examples repo with latest dependencies and was unable to reproduce the issue.

Nx Report

Node : 17.5.0
   OS   : linux x64
   npm  : 8.4.1
   
   nx                      : 15.7.0
   @nrwl/jest              : 15.7.0
   @nrwl/linter            : 15.7.0
   @nrwl/workspace         : 15.7.0
   @nrwl/angular           : 15.7.0
   @nrwl/cli               : 15.7.0
   @nrwl/cypress           : 15.7.0
   @nrwl/devkit            : 15.7.0
   @nrwl/eslint-plugin-nx  : 15.7.0
   @nrwl/js                : 15.7.0
   @nrwl/rollup            : 15.7.0
   @nrwl/tao               : 15.7.0
   @nrwl/web               : 15.7.0
   @nrwl/webpack           : 15.7.0
   typescript              : 4.9.5
   ---------------------------------------
   Community plugins:
   @ngrx/store-devtools : 15.3.0

Failure Logs

Unable to read angular.json
RangeError: Maximum call stack size exceeded
    at arrayBufferToString (/home/david/Development/stemcmono/node_modules/nx/src/adapter/ngcli-adapter.js:256:32)
    at /home/david/Development/stemcmono/node_modules/nx/src/adapter/ngcli-adapter.js:241:73
    at /home/david/Development/stemcmono/node_modules/rxjs/dist/cjs/internal/operators/map.js:10:37
    at OperatorSubscriber._this._next (/home/david/Development/stemcmono/node_modules/rxjs/dist/cjs/internal/operators/OperatorSubscriber.js:33:21)
    at OperatorSubscriber.Subscriber.next (/home/david/Development/stemcmono/node_modules/rxjs/dist/cjs/internal/Subscriber.js:51:18)
    at SafeSubscriber.__tryOrUnsub (/home/david/Development/stemcmono/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:205:16)
    at SafeSubscriber.next (/home/david/Development/stemcmono/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:143:22)
    at Subscriber._next (/home/david/Development/stemcmono/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:89:26)
    at Subscriber.next (/home/david/Development/stemcmono/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Observable._subscribe (/home/david/Development/stemcmono/node_modules/@angular-devkit/core/node/host.js:130:17)

Additional Information

Issue appears to be caused by @nrwl/workspace package as other packages can be upgraded with out problems.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 4
  • Comments: 22 (5 by maintainers)

Most upvoted comments

Very similar issue here, but with a different call stack:

I got the same error after upgrading to 15.7.1, I don’t have a angular.json file at all for my angular project.

After some more detailed investigation I discovered not all my project.json contained name property for the library. Not sure why some of my libraries had these and others did not.

project.json

{
  "name": "ui-shared-components", // <- This was missing and need to add it to project
  "$schema": "../../../../node_modules/nx/schemas/project-schema.json",
  "projectType": "library",
  "sourceRoot": "libs/ui/shared/components/src",
  "prefix": "cts",
...
}

After fixing all my project.json files, the error went away.

Another interesting collision that occurred with the name is that it needs to be not only be unique (which I already knew), but the you cannot use have suffix names

  • ui-shared-components
  • ui-shared-components-input

Having the library called ui-shared-components will cause the ui-shared-components-input to fail. This caused an issue with the e2e project namings as well my-app and my-app-e2e caused a conflict.