angular-cli


Angular CLI (AOT) gives error: ERROR in Cannot determine the module for class


I have recently migrated my project to use Angular CLI to package my project. It works fine using "ng build" but when I try to use "ng build --prod" (which in turn uses Angular AOT and other additional steps) I get these errors:
ERROR in Cannot determine the module for class CustomDialog in F:/depot/depot/code/main/web/CedarsReport/src/a
pp/dialogs/customDialog.ts! Add CustomDialog to the NgModule to fix it.
Cannot determine the module for class ConfirmDialog in F:/depot/depot/code/main/web/CedarsReport/src/app/dialo
gs/confirmDialog.ts! Add ConfirmDialog to the NgModule to fix it.
Cannot determine the module for class EditUserDialog in F:/depot/depot/code/main/web/CedarsReport/src/app/dial
ogs/editUserDialog.ts! Add EditUserDialog to the NgModule to fix it.
Cannot determine the module for class LoginDialog in F:/depot/depot/code/main/web/CedarsReport/src/app/dialogs
/loginDialog.ts! Add LoginDialog to the NgModule to fix it.
Cannot determine the module for class EditAllControlsDlg in F:/depot/depot/code/main/web/CedarsReport/src/app/
dialogs/editAllControlsDlg.ts! Add EditAllControlsDlg to the NgModule to fix it.
Cannot determine the module for class EmptyTemplateDlg in F:/depot/depot/code/main/web/CedarsReport/src/app/di
alogs/emptyDialogTemplate.ts! Add EmptyTemplateDlg to the NgModule to fix it.
Cannot determine the module for class PopupSkeleton in F:/depot/depot/code/main/web/CedarsReport/src/app/direc
tives/popupSkeleton.ts! Add PopupSkeleton to the NgModule to fix it.
However, most of these files ARE referenced in a module called CRDialogs.module.ts:
import { NgModule } from '#angular/core';
import { CommonModule } from '#angular/common'; // ngFor, ngIf, ngStyle, and so on
import { Ng2Bs3ModalModule, ModalComponent } from 'ng2-bs3-modal/ng2-bs3-modal';
// Some dialogs use directives we've created
import { CRDirectives } from '../directives/CRDirectives.module';
// What we want to declare and export. Also, anything in 'imports' below is made available to all of these components
import { ChangePasswordDialog } from "./changePasswordDialog"
import { ConfirmDialog } from "./ConfirmDialog"
import { CreateShortcutDialog } from "./CreateShortcutDialog"
import { CustomDialog } from "./CustomDialog"
import { EditControlDlg } from "./EditControlDlg"
import { EditSectionDlg } from "./EditSectionDialog"
import { EditSitesDialog } from "./EditSitesDialog"
import { StandardFieldDialog } from "./editStandardFieldDialog"
import { EditUserDialog } from "./EditUserDialog"
import { ErrorsDialog } from "./ErrorsDialog"
import { GenericListDlg } from "./GenericListDialog"
import { LoginDialog } from "./LoginDialog"
import { ReferringPhysDialog } from "./ReferringPhysDialog"
import { SignReportDlg } from "./SignReportDlg"
#NgModule(
{
imports: [CommonModule, CRDirectives, Ng2Bs3ModalModule], // Other modules to import
declarations: [
ChangePasswordDialog, ConfirmDialog, CreateShortcutDialog, CustomDialog, EditControlDlg, EditSectionDlg, EditSitesDialog,
EditUserDialog, StandardFieldDialog, ErrorsDialog, GenericListDlg, LoginDialog, ReferringPhysDialog, SignReportDlg
],
exports: [
ChangePasswordDialog, ConfirmDialog, CreateShortcutDialog, CustomDialog, EditControlDlg, EditSectionDlg, EditSitesDialog,
EditUserDialog, StandardFieldDialog, ErrorsDialog, GenericListDlg, LoginDialog, ReferringPhysDialog, SignReportDlg
]
})
export class CRDialogs {}
And this module in turn is referenced in my app.module.ts:
import { CRGlobals } from "./globals"
[...]
#NgModule({
declarations: [
CSReportMain,
AppTestTemp
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
CRDirectives,
**CRDialogs,**
CRPages,
[...]
],
providers: [
CRGlobals
],
bootstrap: [CSReportMain]
})
Here it main.ts:
import { enableProdMode } from '#angular/core';
import { platformBrowserDynamic } from '#angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule);
So why am I getting this error?

Related Links

angularCLI Access-Control-Allow-Origin Multiple Origin Domains
Angular CLI how to merge json files
Angular CLI (ng) use single instead of double quotes
can't install angular cli on ubuntu 16.04
How to solve No 'Access-Control-Allow-Origin' header is present on the requested resource with angular 2 service written with angular-cli?
Usage of watch parameter in eject command of Angular CLI
Serving and testing a bundle after ng build
routerLink stopped working in #angular/cli
How to run Angularcli project with https
what is npm i bootstrap#next?
Angular-Cli Best way to manage notices
Puzzling angular-cli AOT error
Create Project with Angular 4 Release using angularcli
addons removed in angular-cli.json whats the replacement
angular-cli: ng serve command with config error
Augury Angular-cli When I installed the augury .Error is as follows

Categories

HOME
sql-server-2008
makefile
project-management
dynamics-crm
websphere
ubuntu-12.04
tomcat7
csvhelper
algorithmic-trading
websphere-liberty
aruco
pca
vuex
unity2d
lotus-notes
window
onsen-ui2
cpanel
simple-injector
line-api
rapidjson
sendkeys
scaling
jsonserializer
esql
google-maps-android-api-2
epicor
spring-ws
myob
pdfsharp
compare-and-swap
lync-2013
metadata-extractor
helper
nesc
fileinfo
gpib
strophe
stocks
canvasjs
bing-maps-api
ksoap
nodeclipse
mms
rhel.net
coreclr
rule
nsexception
xbim
homekit
lftp
z3py
prototypejs
chown
azureportal
openh264
react-native-fbsdk
static-code-analysis
sqlexception
rxvt
iron.io
libtiff.net
mongoose-populate
try-finally
uiprogressview
freetype2
financial
handlebars.java
zuora
team-build
on-duplicate-key
rx-groovy
type-mismatch
pgm
xaml-designer
android-search
sysctl
candidate-key
ultrawingrid
formvalidation-plugin
aquafold
alpha-transparency
proxies
argument-passing
circos
osx-snow-leopard
execvp
ruboto
fortran77
htmltextwriter
pitch
applicationcontext
dcpu-16
pantheios
linfu
pci-bus

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App