0
votes

ERROR Error: Uncaught (in promise): Error: Type LoginPage is part of the declarations of 2 modules: AppModule and LoginPageModule! Please consider moving LoginPage to a higher module that imports AppModule and LoginPageModule. You can also create a new NgModule that exports and includes LoginPage then import that NgModule in AppModule and LoginPageModule. Error: Type LoginPage is part of the declarations of 2 modules: AppModule and LoginPageModule! Please consider moving LoginPage to a higher module that imports AppModule and LoginPageModule. You can also create a new NgModule that exports and includes LoginPage then import that NgModule in AppModule and LoginPageModule.

I am trying to build an ionic 4 application for login, everything works fine when i am running the home page of the application, but when i try to run my generated pages of login, there isn't the error in the file but the output page on the browser is blank, and when i check the console of the browser, the above error is occured.enter image description hereenter image description here

4
Please post some code.hrdkisback
Show me please your appModuleAnton Skybun
A component can be declared only once. LoginPage is in declarations of LoginPage module and AppModule.. remove it from AppModule declarations.Akhil Naidu
I have shared to codes via images linkEbrahim Mithaiwala

4 Answers

0
votes

This is an error because you use same declaration component in 2 modules AppModule and LoginPageModule. If you need to use 2 components in different modules you can try to use sharedModule where you can add your component and import sharedModule when you need it.

0
votes

You have declared LoginPage in both LoginPageModule and AppModule. Remove it from One module.

0
votes

Go in your app.module.ts file and remove LoginPage from the declarations

-1
votes

Removed the LoginPage declaration from AppModule and got the result.