ionic-framework: Property 'forChild' does not exist on type 'typeof IonicModule'.

I’m using the ionic cli to generate the page using this command

ionic generate page MyTeams

then i get this error

Typescript Error
Property 'forChild' does not exist on type 'typeof IonicModule'.
E:/Source Code/Study/Ionic/elite-schedule-app/src/pages/game/game.module.ts
imports: [
  IonicModule.forChild(Game),
],

Have anybody encounter with this error ?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 10
  • Comments: 20 (2 by maintainers)

Most upvoted comments

https://docs.google.com/document/d/1vGokwMXPQItZmTHZQbTO4qwj_SQymFhRS_nJmiH0K3w/edit# it was introduced for lazy loading… I think someone made a typo… should be IonicPageModule instead of IonicModule…

Referencing the wrong Ionic module, IonicModule which does not have the forChild method. Change your import from IonicModule to IonicPageModule.

I also tried to remove

imports: [ IonicModule.forChild(Registeration), ],

now it works tanx to ngohungphuc

Is there any way to avoid this “page.module.ts” when I put g page on the command line ?

I hate it