TypeError: chartModule is not a function
See original GitHub issueHi.
I have a problem using angular-highcharts-stockchart.
I paste example code in my code.
But it occurs an error.
in Chrome console :
TypeError: chartModule is not a function
at eval (angular-highcharts.es5.js:245)
at Array.forEach (<anonymous>)
at ChartService.initModules (angular-highcharts.es5.js:244)
at new ChartModule (angular-highcharts.es5.js:274)
at _createClass (core.js:10915)
at _createProviderInstance$1 (core.js:10889)
at initNgModule (core.js:10842)
at new NgModuleRef_ (core.js:12096)
at createNgModuleRef (core.js:12086)
at Object.debugCreateNgModuleRef [as createNgModuleRef] (core.js:14430)
Below that is my code snippet.
app.module.ts :
...
import {ChartModule, HIGHCHARTS_MODULES} from 'angular-highcharts';
import highstock from 'highcharts/modules/stock.src';
import exporting from 'highcharts/modules/exporting.src';
export function highchartsModules() {
// apply Highstock Modules to this array
return [highstock, exporting];
}
...
@NgModule({
declarations: [
AppComponent,
SigninComponent,
StrategyListComponent,
StrategyDetailComponent,
StrategyComponent
],
imports: [
...
],
providers: [
...
{provide: HIGHCHARTS_MODULES, useFactory: highchartsModules}
],
bootstrap: [AppComponent]
})
export class AppModule {
}
package.json :
...
"@angular/cdk": "^5.0.2",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/material": "^5.0.2",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"angular-highcharts": "^5.2.0",
"core-js": "^2.4.1",
"highcharts": "^6.0.4",
...
Issue Analytics
- State:
- Created 6 years ago
- Comments:48 (11 by maintainers)
Top Results From Across the Web
Angular 2 - AOT - Calling function 'ChartModule', function calls ...
ERROR in Error encountered resolving symbol values statically. Calling function 'ChartModule'. function calls are not supported. Consider ...
Read more >Angular 2 : AOT TypeError: base64 is not a function-angular.js
i found answer , its node js doing problem here , AOT requires node js v6+ , i just update my node and...
Read more >charts not working [#3026499] | Drupal.org
It throws me this error (in the console): Uncaught TypeError: $(...).highcharts is not a function Any idea on how to resolve this issue?...
Read more >Integration | Chart.js
You can pick and choose many of these, e.g. if you are not going to use ... require(['path/to/chartjs/dist/chart.umd.js'], function(Chart){ ...
Read more >Chart.js: Uncaught TypeError: Cannot read property &#039
js in conjunction with the mdb chart module. To avoid any issues with the imports, I only included the import { MDBBootstrapModulesPro }...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@joeykruger @ubirajr The workaround (as mentioned in https://github.com/angular/angular-cli/issues/9058#issuecomment-355021360) is to force the default import for your chart module imports. So do
instead of
for all your chart modules.
@attilacsanyi Tried providers: [ {provide: HIGHCHARTS_MODULES, useFactory: () => [drilldown] }], Its working 😃. Appreciate your help 👍 Thanks.