我在应用程序中使用Angular 4.4.1 + SystemJS 0.20.19 + NgBootstrap 1.0.0-beta.5。该应用程序按照此说明在Angular JIT模式下工作并具有以下SystemJS配置
meta: {
"./*": {
"esModule": true
}
}
我使用“node_modules/.bin/ngc”-p tsconfig-aot.json将应用程序编译为AOT应用程序。
在AOT应用程序中,我有SystemJS map
配置,如本问题末尾所示。
在 JIT 模式下工作的同一应用程序在 AOT 模式下不工作,并生成以下错误:
ERROR Error: Uncaught (in promise): TypeError: ctor is not a constructor
TypeError: ctor is not a constructor
at _createClass (core.umd.min.js:90)
at _createProviderInstance$1 (core.umd.min.js:90)
at resolveNgModuleDep (core.umd.min.js:90)
at NgModuleRef_.get (core.umd.min.js:210)
at resolveNgModuleDep (core.umd.min.js:90)
at _createClass (core.umd.min.js:90)
at _createProviderInstance$1 (core.umd.min.js:90)
at resolveNgModuleDep (core.umd.min.js:90)
at NgModuleRef_.get (core.umd.min.js:210)
at resolveDep (core.umd.min.js:97)
at _createClass (core.umd.min.js:90)
at _createProviderInstance$1 (core.umd.min.js:90)
at resolveNgModuleDep (core.umd.min.js:90)
at NgModuleRef_.get (core.umd.min.js:210)
at resolveNgModuleDep (core.umd.min.js:90)
at _createClass (core.umd.min.js:90)
at _createProviderInstance$1 (core.umd.min.js:90)
at resolveNgModuleDep (core.umd.min.js:90)
at NgModuleRef_.get (core.umd.min.js:210)
at resolveDep (core.umd.min.js:97)
at resolvePromise (config.ts:60)
at resolvePromise (config.ts:60)
at config.ts:60
at ZoneDelegate.invokeTask (config.ts:60)
at Object.onInvokeTask (core.umd.min.js:41)
at ZoneDelegate.invokeTask (config.ts:60)
at Zone.runTask (config.ts:60)
at drainMicroTaskQueue (config.ts:60)
at <anonymous>
问题:
我无法知道哪个模块导致了这个错误。
NgBootstrao NgbModel
经过多次调试,加载时出现错误。如何修复此错误?是否有一些配置设置可用于查看SystemJS在浏览器控制台中加载的模块的进度/日志?
NgBootstrap 的 SystemJS 映射:
@ng-bootstrap/ng-bootstrap : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/modal/modal-stack": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/modal/modal": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/alert/alert-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/progressbar/progressbar-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/tooltip/tooltip-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/typeahead/typeahead-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/accordion/accordion-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/carousel/carousel-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/datepicker/ngb-calendar": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/datepicker/datepicker-i18n": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/datepicker/ngb-date-parser-formatter": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/datepicker/datepicker-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/dropdown/dropdown-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/pagination/pagination-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/popover/popover-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/rating/rating-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/tabset/tabset-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/timepicker/timepicker-config": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/alert/alert.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/buttons/buttons.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/collapse/collapse.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/progressbar/progressbar.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/tooltip/tooltip.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/typeahead/typeahead.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/accordion/accordion.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/carousel/carousel.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/datepicker/datepicker.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/dropdown/dropdown.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/dropdown/dropdown": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/datepicker/datepicker-input": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/modal/modal.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/pagination/pagination.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/popover/popover.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/rating/rating.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/tabset/tabset.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/timepicker/timepicker.module": /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
"@ng-bootstrap/ng-bootstrap/index" : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/alert/alert : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/tooltip/tooltip : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/typeahead/highlight : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/typeahead/typeahead-window : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/modal/modal-window : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/modal/modal-backdrop : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/datepicker/datepicker-day-view : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/datepicker/datepicker-month-view : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/datepicker/datepicker : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/datepicker/datepicker-navigation : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/datepicker/datepicker-service : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/datepicker/datepicker-keymap-service : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/popover/popover : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/datepicker/datepicker-navigation-select : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,
@ng-bootstrap/ng-bootstrap/modal/modal-ref : /lib/@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js ,