Angular 7: Uncaught TypeError: Object(...) is not a function at coreui-angular.js:865

1.2k views Asked by At

Getting below error in the console:

Uncaught TypeError: Object(...) is not a function at coreui-angular.js:865 at Module../node_modules/@coreui/angular/fesm5/coreui-angular.js (coreui-angular.js:867) at webpack_require (bootstrap:83) at Module../src/app/app.module.ts (app.component.ts:9) at webpack_require (bootstrap:83) at Module../src/main.ts (main.ts:1) at webpack_require (bootstrap:83) at Object.0 (main.ts:15) at webpack_require (bootstrap:83) at checkDeferredModules (bootstrap:45)

Also, I am getting below WARNING on build and on ng serve:

WARNING in ./node_modules/@coreui/angular/fesm5/coreui-angular.js 865:62-80 "export 'ɵɵdefineInjectable' was not found in '@angular/core'

WARNING in ./node_modules/@coreui/angular/fesm5/coreui-angular.js 865:166-174 "export 'ɵɵinject' was not found in '@angular/core'

WARNING in ./node_modules/@coreui/angular/fesm5/coreui-angular.js 865:184-192 "export 'ɵɵinject' was not found in '@angular/core'

Below is my package.json

{
  "dependencies": {
    "@angular/animations": "^7.2.0",
    "@angular/cdk": "^7.2.0",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/material": "^7.2.0",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "~7.2.0",
    "@coreui/angular": "2.5.5",
    "@coreui/coreui": "^3.3.0",
    "@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.3.1",
    "@ng-bootstrap/ng-bootstrap": "4.2.2",
    "bootstrap": "^4.2.1",
    "chart.js": "^2.9.3",
    "core-js": "^2.5.4",
    "html2canvas": "^1.0.0-rc.7",
    "mutationobserver-shim": "^0.3.7",
    "ng2-charts": "^2.2.3",
    "ngx-bootstrap": "^3.2.0",
    "ngx-perfect-scrollbar": "^10.0.1",
    "ngx-spinner": "7.2.0",
    "primeng": "^7.0.5",
    "rxjs": "~6.3.3",
    "tslib": "^1.9.0",
    "web-animations-js": "^2.3.2",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "~7.3.10",
    "@angular/compiler-cli": "~7.2.0",
    "@angular/language-service": "~7.2.0",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.1.1"
  }
}
1

There are 1 answers

1
Lakshay On

Downgraded @coreui/angular package to "2.5.3" and it worked.

https://www.npmjs.com/package/@coreui/angular/v/2.5.3