nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.84k stars 2.38k forks source link

TypeError: registry.compile(...).pipe is not a function #20385

Closed rbeier closed 10 months ago

rbeier commented 1 year ago

Current Behavior

Hi,

after the update from angular 14 to angular 15.2 we're not able to generate components/directives/pipes/... anymore.

Error output:

nx generate component TestComponent --project=e2e --verbose

>  NX  Generating @nrwl/angular:component

TypeError: registry.compile(...).pipe is not a function
    at /Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/tools/schema-option-transform.js:28:59
    at transform (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:232:43)
    at NodeModulesEngineHost.transformOptions (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:239:33)
    at SchematicEngine.transformOptions (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/src/engine/engine.js:263:27)
    at MergeMapSubscriber.project (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/src/engine/schematic.js:40:14)
    at MergeMapSubscriber._tryNext (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:67:27)
    at MergeMapSubscriber._next (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
    at Subscriber.next (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:66:18)
    at ThrowIfEmptySubscriber._next (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/throwIfEmpty.js:44:26)
    at Subscriber.next (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:66:18)

 >  NX   registry.compile(...).pipe is not a function

TypeError: registry.compile(...).pipe is not a function
    at /Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/tools/schema-option-transform.js:28:59
    at transform (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:232:43)
    at NodeModulesEngineHost.transformOptions (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:239:33)
    at SchematicEngine.transformOptions (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/src/engine/engine.js:263:27)
    at MergeMapSubscriber.project (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/src/engine/schematic.js:40:14)
    at MergeMapSubscriber._tryNext (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:67:27)
    at MergeMapSubscriber._next (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
    at Subscriber.next (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:66:18)
    at ThrowIfEmptySubscriber._next (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/operators/throwIfEmpty.js:44:26)
    at Subscriber.next (/Users/robin.beier/dev/work/drg-suite/frontends/node_modules/@angular-devkit/schematics/node_modules/rxjs/internal/Subscriber.js:66:18)

I tried some solutions suggested in other issues like https://github.com/nrwl/nx/issues/16736 and https://github.com/nrwl/nx/issues/17215 but these are not fixing the issue.

npm ls @angular-devkit/architect
frontends@0.0.0 /Users/robin.beier/dev/work/drg-suite/frontends
├─┬ @angular-devkit/build-angular@15.2.10
│ ├── @angular-devkit/architect@0.1502.10
│ └─┬ @angular-devkit/build-webpack@0.1502.10
│   └── @angular-devkit/architect@0.1502.10 deduped
├─┬ @angular/cli@15.2.10
│ └── @angular-devkit/architect@0.1502.10 deduped
└─┬ @storybook/angular@7.5.3
  └── @angular-devkit/architect@0.1502.10 deduped

Expected Behavior

i would expect to create the component in project e2e

GitHub Repo

No response

Steps to Reproduce

  1. create a project with angular 15.x npx create-nx-workspace@15.2
  2. overwrite package.json
  3. try to create a component

Nx Report

"dependencies": {
    "@angular-material-components/datetime-picker": "15.0.0",
    "@angular/animations": "^15.2.0",
    "@angular/cdk": "^15.2.0",
    "@angular/common": "^15.2.0",
    "@angular/compiler": "^15.2.0",
    "@angular/core": "^15.2.0",
    "@angular/forms": "^15.2.0",
    "@angular/localize": "^15.2.0",
    "@angular/material": "^15.2.9",
    "@angular/material-moment-adapter": "^15.2.9",
    "@angular/platform-browser": "^15.2.0",
    "@angular/platform-browser-dynamic": "^15.2.0",
    "@angular/router": "^15.2.0",
    "@ngneat/transloco": "^4.3.0",
    "@ngneat/transloco-messageformat": "^4.1.0",
    "@ngneat/until-destroy": "9.2.1",
    "@ngrx/store": "^15.4.0",
    "@ngxs-labs/actions-executing": "1.0.6",
    "@ngxs-labs/select-snapshot": "^5.0.0",
    "@ngxs/form-plugin": "3.8.1",
    "@ngxs/router-plugin": "3.8.1",
    "@ngxs/storage-plugin": "3.8.1",
    "@ngxs/store": "3.8.1",
    "@nrwl/angular": "^15.2.0",
    "@rxweb/reactive-form-validators": "^13.0.1",
    "angular-auth-oidc-client": "^15.0.5",
    "angular-shepherd": "^15.0.0",
    "angular-split": "^15.0.0",
    "date-fns": "^2.30.0",
    "eslint-plugin-etc": "^2.0.3",
    "jwt-decode": "3.1.2",
    "license-report": "^6.5.0",
    "localforage": "^1.10.0",
    "lodash-es": "4.17.21",
    "mat-table-exporter": "^15.0.0",
    "moment": "^2.29.4",
    "ng-mocks": "^14.11.0",
    "ngx-currency": "2.5.3",
    "ngx-mat-select-search": "^6.0.0",
    "ngx-sub-form": "^8.0.1",
    "rxjs": "^7.8.1",
    "tslib": "^2.3.0",
    "uuid": "8.3.2",
    "zone.js": "^0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^15.2.0",
    "@angular-eslint/eslint-plugin": "^15.2.0",
    "@angular-eslint/eslint-plugin-template": "^15.2.0",
    "@angular-eslint/template-parser": "^15.2.0",
    "@angular/cli": "^15.2.0",
    "@angular/compiler-cli": "^15.2.0",
    "@angular/language-service": "^15.2.0",
    "@ngneat/spectator": "^14.0.0",
    "@ngxs/devtools-plugin": "3.8.1",
    "@nrwl/cli": "^15.2.0",
    "@nrwl/cypress": "^15.2.0",
    "@nrwl/eslint-plugin-nx": "^15.2.0",
    "@nrwl/jest": "^15.2.0",
    "@nrwl/linter": "^15.2.0",
    "@nrwl/storybook": "^15.2.0",
    "@nrwl/workspace": "^15.2.0",
    "@storybook/addon-docs": "7.5.3",
    "@storybook/addon-essentials": "7.5.3",
    "@storybook/angular": "7.5.3",
    "@storybook/core-server": "7.5.3",
    "@swc-node/register": "^1.4.2",
    "@swc/core": "^1.2.173",
    "@testing-library/cypress": "8.0.2",
    "@types/jest": "28.1.3",
    "@types/node": "16.11.36",
    "@types/uuid": "8.3.4",
    "@typescript-eslint/eslint-plugin": "5.54.0",
    "@typescript-eslint/parser": "5.54.0",
    "@typescript-eslint/utils": "^5.36.1",
    "cypress": "9.1.0",
    "cypress-file-upload": "5.0.8",
    "cypress-keycloak-commands": "1.2.0",
    "eslint": "8.15.0",
    "eslint-config-prettier": "8.1.0",
    "eslint-plugin-cypress": "2.10.3",
    "eslint-plugin-storybook": "^0.6.15",
    "jest": "^29.7.0",
    "jest-environment-jsdom": "^29.7.0",
    "jest-preset-angular": "^13.1.3",
    "lodash": "4.17.21",
    "nx": "^15.2.0",
    "prettier": "2.8.1",
    "storybook-addon-themes": "^6.1.0",
    "ts-jest": "29.1.1",
    "ts-node": "10.9.1",
    "typescript": "^4.8.2"
  }


### Failure Logs

_No response_

### Package Manager Version

9.8.1

### Operating System

- [X] macOS
- [ ] Linux
- [ ] Windows
- [ ] Other (Please specify)

### Additional Information

_No response_
rbeier commented 10 months ago

Fixed it with the help of this comment https://github.com/nrwl/nx/issues/17215#issuecomment-1566838586

Problem was, that @angular-devkit/core was not in the dev dependencies...

github-actions[bot] commented 9 months ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.