fusioncharts / angular-fusioncharts

Angular Component for FusionCharts JavaScript Charting Library
https://fusioncharts.github.io/angular-fusioncharts/#/ex1
Other
55 stars 37 forks source link

TypeError: core is not a function Angular v10 #120

Open hebertlima opened 3 years ago

hebertlima commented 3 years ago
// config

import { FusionChartsModule } from 'angular-fusioncharts';
import * as FusionCharts from 'fusioncharts';
import * as Powercharts from 'fusioncharts/fusioncharts.powercharts';
import * as FusionTheme from 'fusioncharts/themes/fusioncharts.theme.fusion';
import * as ExcelExport from 'fusioncharts/fusioncharts.excelexport';
import * as Chart from 'fusioncharts/fusioncharts.charts';

FusionChartsModule.forRoot(
    FusionCharts,
    Powercharts,
    FusionTheme,
    ExcelExport,
    Chart
);

ERROR TypeError: core is not a function
at FusionChartsService.push.VJ9t.FusionChartsService.resolveFusionCharts  (fusioncharts.service.js:41)

 // fusioncharts.service.js
 FusionChartsService.prototype.resolveFusionCharts = function (core, modules) {
        if (core && core.id && core.id === 'FusionCharts') {
            this._fusionchartsStatice = core;
        }
        else {
            this._fusionchartsStatice = core(); // exception here
        }

packages:

 "dependencies": {
    "@angular/animations": "~10.1.4",
    "@angular/common": "~10.1.4",
    "@angular/compiler": "~10.1.4",
    "@angular/core": "~10.1.4",
    "@angular/forms": "~10.1.4",
    "@angular/localize": "~10.1.4",
    "@angular/platform-browser": "~10.1.4",
    "@angular/platform-browser-dynamic": "~10.1.4",
    "@angular/router": "~10.1.4",
    "@ng-bootstrap/ng-bootstrap": "^9.1.2",
    "@ngx-loading-bar/core": "^5.1.0",
    "@ngx-loading-bar/http-client": "^5.1.0",
    "angular-feather": "^6.1.0",
    "angular-fusioncharts": "3.0.4",
    "bootstrap": "^4.5.0",
    "fusioncharts": "^3.16.0",
    "jsencrypt": "3.0.0-beta.1",
    "moip-sdk-js": "^2.1.1",
    "ngx-cookie-service": "^10.1.1",
    "ngx-currency": "^2.5.2",
    "ngx-guided-tour": "^1.1.11",
    "ngx-mask": "^11.1.4",
    "ngx-permissions": "^8.1.1",
    "ngx-quill": "^13.2.0",
    "quill": "^1.3.7",
    "rxjs": "~6.6.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1001.4",
    "@angular/cli": "~10.1.4",
    "@angular/compiler-cli": "~10.1.4",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~4.0.2"
  }
AyanBhadury commented 3 years ago

ngCC compilation issue has been fixed, please upgrade to 3.2.0: http://www.npmjs.com/package/angular-fusioncharts

@hebertlima

joansmca commented 1 year ago

core.mjs:8400 ERROR TypeError: core is not a function at FusionChartsService.resolveFusionCharts (fusioncharts.service.js:42:41) at new FusionChartsService (fusioncharts.service.js:26:14) at NodeInjectorFactory.FusionChartsService_Factory [as factory] (fusioncharts.service.js:65:81) at getNodeInjectable (core.mjs:3431:44) at searchTokensOnInjector (core.mjs:3368:16) at lookupTokenUsingNodeInjector (core.mjs:3317:34) at getOrCreateInjectable (core.mjs:3240:23) at Module.ɵɵdirectiveInject (core.mjs:10041:12) at NodeInjectorFactory.FusionChartsComponent_Factory [as factory] (fusioncharts.component.js:369:175) at getNodeInjectable (core.mjs:3431:44)

using "angular-fusioncharts": "^4.0.3", "fusioncharts": "^3.20.0",

AyanBhadury commented 1 year ago

@joansmca you can use this demo - https://github.com/AyanBhadury/angular-fusioncharts-sample