簡體   English   中英

在“路徑”中鍵入“名稱”是 2 個模塊聲明的一部分:構建 Ionic 4 項目時出錯

[英]Type “name” in “path” is part of the declarations of 2 modules: Error while building an Ionic 4 project

我嘗試使用以下命令構建我的 Ionic 應用程序:

ionic cordova 平台添加瀏覽器

接着

ionic cordova 構建瀏覽器 --prod --release

但出現了這個奇怪的錯誤: https://prnt.sc/pf58hd

Github 鏈接到我的項目: https://github.com/TenPetr/to_do_list

Angular 版本: 8.1.2

離子版本: 4.7.1

感謝您的建議。

錯誤很明顯,您在AppModuleAddNewLabelsPageModule等兩個模塊中聲明了AddNewLabelsPage

從 AppModule 中刪除聲明,但更新 AppModule 配置以導入您的 AddNewLabelsPageModule。

你的 app.module 應該看起來像,

@NgModule({
  declarations: [
    AppComponent,
    DoneAllPage,
    SettingsPage
  ],
  entryComponents: [AddNewTaskPage, DoneAllPage, SettingsPage],
  imports: [
    BrowserModule,
    FormsModule,
    IonicModule.forRoot(),
    AppRoutingModule,
    AddNewTaskPageModule
  ],
  providers: [
    StatusBar,
    SplashScreen,
    TimeDateService,
    TasksService,
    LabelsService,
    SettingsService,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

暫無
暫無

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

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