angular 构建 --prod 错误

angular build --prod error

Type src/app/createreportcomponent component.ts 是 2 个模块错误声明的一部分,但正常的开发构建工作正常。如何修复错误

****应用模块 ts 文件****

import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { AngularDualListBoxModule } from 'angular-dual-listbox';

import { HomeComponent } from './home/home.component';
import { CreatereportComponent } from './createreport/createreport.component';
import { AppRoutingModule } from './app-routing.module';

import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HashLocationStrategy, LocationStrategy } from '@angular/common';
import { HttpModule } from '@angular/http';

import { Angular2CsvModule } from 'angular2-csv';

// import {ToastModule} from 'ng2-toastr/ng2-toastr';

import { CommonService } from './services/common.service';

@NgModule({
  declarations: [
    AppComponent,
    HomeComponent,
    CreatereportComponent
  ],
  imports: [
     BrowserModule,
     AngularDualListBoxModule,
    BrowserAnimationsModule,
    AppRoutingModule,
    HttpModule,
    FormsModule,
    Angular2CsvModule,
   // ToastModule.forRoot(),
  ],
  providers: [{provide: LocationStrategy, useClass: HashLocationStrategy},CommonService],
  bootstrap: [AppComponent]
})
export class AppModule { }

创建组件 ts 文件

如果您在另一个模块中使用 'createreportcomponent',则将其从主模块中删除。