1

Current Behavior:

I get an error when I try to generate a page with a given path.


Expected Behavior:

The page should be created in the desired path.


$ ionic generate page auth/pages/login

> ng generate page /auth/pages/login
Cannot read property 'kind' of undefined
[ERROR] Could not generate page.

$ ionic info

Ionic:

ionic (Ionic CLI)          : 4.1.2 (...\npm\node_modules\ionic)
Ionic Framework            : @ionic/angular 4.0.0-beta.7
@angular-devkit/core       : 0.7.5
@angular-devkit/schematics : 0.7.5
@angular/cli               : 6.1.5
@ionic/ng-toolkit          : 1.0.8
@ionic/schematics-angular  : 1.0.6

System:

NodeJS : v8.10.0 (C:\Program Files\nodejs\node.exe)
npm    : 6.4.1
OS     : Windows 10

PS:

When I try to generate a component on to a given path, it wo

Eliya Cohen
  • 10,716
  • 13
  • 59
  • 116

1 Answers1

1

Well, the reason I received this error was that I haven't actually known what goes under the hood. Usually, when I work with Angular CLI, I create a module, and inside it components and containers. What I didn't expect, was that generating a page will do:

  • Create a new lazy module.
  • Link it to the app routing.
  • Generate a new component, but instead of Component suffix, a Page suffix.

The reason it failed to create the page, was probably because it tried to add something that was already there.

Eliya Cohen
  • 10,716
  • 13
  • 59
  • 116