@IonicPage decorator, but it does not have a corresponding "NgModule"

Hi All,

I am facing issue when i am trying to add new page in ionic project.
command #: ionic g page test

Error: has a @IonicPage decorator, but it does not have a corresponding “NgModule”.

Please check the below version information and let me know what is the issues?

karris-MacBook-Pro:myTestApp karri$ ionic info

global packages:

@ionic/cli-utils : 1.5.0
Ionic CLI        : 3.5.0

local packages:

@ionic/app-scripts              : 2.0.1
@ionic/cli-plugin-ionic-angular : 1.3.2
Ionic Framework                 : ionic-angular 3.5.0

System:

Node       : v6.11.1
OS         : macOS Sierra
Xcode      : Xcode 8.2.1 Build version 8C1002 
ios-deploy : 1.8.6 
ios-sim    : 5.0.8 
npm        : 3.10.10 

Thanks
Ravi

Same problem. after update ionic

image
What’s the problem to the new updates?

Did you all generate a page using the CLI?

What exactly got created?
What did you change at the generated files? Did you remove some?

Okay, this is a temporary problem between versions:


(Changing this needs releases in 2 packages (app-scripts and ionic-angular), only one (app-scripts 2.0.1) is already out)

For now, just delete the “@IonicPage” line in the .ts file and you should be good to go.

Hi Sujan,

Thanks for your reply…when i delete @IonicPage() now i am able to build and run the application.

Just want to understand what is the use of .module.ts file. is it not a mandatory file ?

Thanks
Ravi

Ionic 3.x can load pages in two ways: normal and lazy. For lazy loading the additional page.module.ts file and @IonicPage() decorator are needed. By default generated pages should not use that because implementing it is some more work (check the Ionic blog for posts about that).

2 Likes

That solved my problem too, thank you!