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

Angular-cli not generating dist directory with ng build
How to update service json or array value on click in angular2?
How to revert from Angular-cli to Angular without cli for server-side rendering with Angular Universal
How to change file index outside the root
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

Categories

HOME
app-inventor
mql4
npm
vb6
xamarin.android
paramiko
ubuntu-16.04
filter
triggers
requirejs
uiactivityviewcontroller
pjsip
informatica-powercenter
riak
medium-editor
python-unicode
deb
embedly
iup
azure-servicebus-queues
shopping-cart
sumo
switching
visual-c++-2017
multichoiceitems
gzip
dd-wrt
superagent
helix-3d-toolkit
geo
node-horseman
von-neumann
boilerplate
stdclass
html-agility-pack
cppunit
walmart-electrode
react-native-fbsdk
unity3d-editor
qos
pdfkit
sql-server-administration
ebtables
typhoon
vst
update-site
firepath
gameanalytics
radians
mongoskin
xmp
web-essentials
unity5.3
lmfit
futuretask
built-in
bridge
rspec3
stackframe
cocoascript
left-recursion
collabnet
surrogate-key
sgml
joox
mbox
visual-c++-2010-express
sqljdbc
windows-mobile-6
sql-server-2012-web
lame
dwolla
usn
mpmovieplayer
redirectstandardoutput
gjs
signals2
mysql-error-1045
audiostreamer
communicationexception
aio
code-design
filetime
openwysiwyg
callgrind
kpi
winsnmp
associativity

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