Issue
My Angular2 app is giving the following Error after importing "primeng : 1.0.0-beta.15" and
"primeui : 4.1.15"
Please see the following:
zone.js:461 Unhandled Promise rejection: TypeError: core_1.NgModule is not a function
at eval (http://localhost:4200/vendor/primeng/components/common/shared.js:291:16)
at Object.eval (http://localhost:4200/vendor/primeng/components/common/shared.js:299:2)
at eval (http://localhost:4200/vendor/primeng/components/common/shared.js:302:4)
at eval (http://localhost:4200/vendor/primeng/components/common/shared.js:303:3)
Evaluating http://localhost:4200/vendor/primeng/components/common/shared.js
Evaluating http://localhost:4200/vendor/primeng/primeng.js
Evaluating http://localhost:4200/app/app-sidebar/manageSubCatagory.component.js
Evaluating http://localhost:4200/app/app-sidebar/index.js
Evaluating http://localhost:4200/app/app.component.js
Evaluating http://localhost:4200/app/index.js
Evaluating http://localhost:4200/main.js
Error loading http://localhost:4200/main.js ; Zone: <root> ; Task: Promise.then ; Value: Error: TypeError: core_1.NgModule is not a function(…)
I'm using Anguler CLI for this project and my package.json code is
{
"name": "erp",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"postinstall": "typings install",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/forms": "0.2.0",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.2",
"es6-shim": "0.35.1",
"primeng": "^1.0.0-beta.15",
"primeui": "^4.1.15",
"reflect-metadata": "0.1.3",
"rxjs": "5.0.0-beta.6",
"systemjs": "0.19.26",
"zone.js": "0.6.12"
},
"devDependencies": {
"angular-cli": "1.0.0-beta.10",
"codelyzer": "0.0.20",
"ember-cli-inject-live-reload": "1.4.0",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "0.13.22",
"karma-chrome-launcher": "0.2.3",
"karma-jasmine": "0.3.8",
"protractor": "3.3.0",
"ts-node": "0.5.5",
"tslint": "3.11.0",
"typescript": "1.8.10",
"typings": "1.3.1"
}
}
Can you please give me a suggestion to fix this?
Solution
Angular RC 4 doesn't have NgModule. You need to update your Angular dependencies to 2.0.0-rc.5 or higher.
Be sure to check the migration docs for instructions on updating your app to RC5.
Answered By - spongessuck
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.