1

When I try to generate component using angular CLI ng generate component test --skip-import or ng generate component test -m app.module.ts I have an error tree.actions.filter(...).map(...).at is not a function

Does anyone know how to fix it?

ng version

I tried to update the Angular CLI to the latest version globally and in the project. I tried to remove and reinstall the @angular/cli package globally and in the project.

just
  • 11
  • 2

1 Answers1

0

I have my own case when the issue manifested itself. I tracked it down till the commit were Cypress was installed, which modified (among others) following lines in the angular.json - part of the git diff on that commit:

"cli": {
-    "analytics": false
+    "analytics": false,
+    "schematicCollections": [
+      "@cypress/schematic",
+      "@schematics/angular"
+    ]
}

After I removed schematicCollections field, Cypress seems not to be affected, but ng g c <component-name> does the job again.

This does not look like a good solution, and maybe it happens altogether just because I use kinda obsolete node@14 @angular/cli@14 and the latest cypress@17 in this particular project.

Emil
  • 629
  • 2
  • 7
  • 24