簡體   English   中英

離子cordova構建android --prod打字稿錯誤

[英]ionic cordova build android --prod typescript error

我可以使用“ionic cordova build android”構建我的離子項目,但應用程序在設備上運行緩慢。 經過一些研究,我了解到應該使用“離子cordova build android --prod”來增加性能。 然而,當我運行“ionic cordova build android --prod”時,這是我得到的錯誤

Type PinnedmessagesComponent in project/src/components/pinnedmessages/pinnedmessages.ts is part of the declarations of 2 modules: 

ComponentsModule in project/src/components/components.module.ts and
        ProfilePageModule in project/src/pages/profile/profile.module.ts! 

Please consider moving PinnedmessagesComponent in project/src/components/pinnedmessages/pinnedmessages.ts to a higher module that imports ComponentsModule in project/src/components/components.module.ts and 
ProfilePageModule in project/src/pages/profile/profile.module.ts. 

You can also create a new NgModule that exports and includes PinnedmessagesComponent in project/src/components/pinnedmessages/pinnedmessages.ts then import that NgModule in ComponentsModule in project/src/components/components.module.ts and 
ProfilePageModule in project/src/pages/profile/profile.module.ts.

Pinnedmessages是我創建的一個組件,我在另一個名為ProfilePage的頁面中使用它。 請告訴我如何解決這個問題。 謝謝

錯誤告訴你它想要什么。 為該組件創建一個模塊,然后將該模塊包含在您需要該組件的位置。 它不喜歡你有兩個組件聲明,所以它希望你在模塊中有一個,然后導入該模塊。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM