Component is part of the declaration of 2 modules

前端 未结 16 759
我在风中等你
我在风中等你 2020-12-04 06:44

I try to build an ionic 2 app. When I try the app in the browser with ionic serve or launch it on an emulator everything works fine.

But when I try to build it every

16条回答
  •  情书的邮戳
    2020-12-04 07:24

    Solution is very simple. Find *.module.ts files and comment declarations. In your case find addevent.module.ts file and remove/comment one line below:

    @NgModule({
      declarations: [
        // AddEvent, <-- Comment or Remove This Line
      ],
      imports: [
        IonicPageModule.forChild(AddEvent),
      ],
    })
    

    This solution worked in ionic 3 for pages that generated by ionic-cli and works in both ionic serve and ionic cordova build android --prod --release commands!

    Be happy...

提交回复
热议问题