Encountering an error when running:
ng build --prod
However,
ng build
works without any issues.
Despite searching for solutions on Stack Overflow, none of them resolved the problem.
Error: ng build --prod Cannot determine the module for class X! Add ThreadListTabsComponent to the NgModule to fix it
Angular `ng build --prod` issue
Error message displayed below:
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS D:\IT_INF_Hol_INFstructureSuite_Cit\Projects\CitH_UI> ng build --prod
Date: 2018-12-20T08:56:40.759Z
Hash: 89b0db73219a42cd9dc4
Time: 14183ms
chunk {0} runtime.ec2944dd8b20ec099bf3.js (runtime) 1.41 kB [entry] [rendered]
chunk {1} main.9868d9b237c3a48c54da.js (main) 128 bytes [initial] [rendered]
chunk {2} polyfills.85f47f0bf59079cbc23a.js (polyfills) 130 bytes [initial] [rendered]
chunk {3} styles.898f3785f5d9ae4bd624.css (styles) 387 kB [initial] [rendered]
chunk {scripts} scripts.aa85510fa2abfcc665b6.js (scripts) 326 kB [rendered]
ERROR in : Cannot determine the module for class ModelComponet in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/model/model-component.ts! Add ModelComponet to the NgModule to fix it.
Cannot determine the module for class FilterPipe in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Shared/Directives/DataTable/DataFilter.ts! Add FilterPipe to the NgModule to fix it.
Cannot determine the module for class HolCarouselComponent in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/Hol/carousel/Hol-carousel.component.ts! Add HolCarouselComponent to the NgModule to
fix it.
Cannot determine the module for class HolSolutions1Component in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/Hol/solutions/Hol-solution1.component.ts! Add HolSolutions1Component to the NgModule to fix it.
Cannot determine the module for class LogOnComponent in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/log-on/log-on.component.ts! Add LogOnComponent to the NgModule to fix it.
Cannot determine the module for class ManageConfigsCopy in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/manage-configs/manage-configs.component - Copy.ts! Add ManageConfigsCopy to the NgModule to fix it.Cannot determine the module for class TestComponent in D:/IT_INF_Hol_INFstructureSuite_Cit/Projects/CitH_UI/src/app/Views/test-jp/test.component.ts! Add TestComponent to the NgModule to fix it.
model-component.ts
import { Component, OnInit } from '@angular/core';
import {ModalModule} from "ngx-modal";
import { NgModule } from '@angular/core'
@Component({
selector: 'ngx-model',
templateUrl: './model-component.html'
})
export class ModelComponet implements OnInit {
// lstMenuItems:MenuEntities[];
// constructor(private Menu_Service:MenuService,private clsmenu:MenuEntities) { }
constructor() { }
ngOnInit() {
//this.loadMenu();
}
}