Issue
I am having this error with chartJS and primeNG:
ERROR TypeError: chart_js__WEBPACK_IMPORTED_MODULE_2__ is not a constructor
at UIChart.initChart (primeng-chart.js:48)
at UIChart.ngAfterViewInit (primeng-chart.js:29)
at callHook (core.js:3038)
at callHooks (core.js:3008)
at executeInitAndCheckHooks (core.js:2960)
at refreshView (core.js:7243)
at refreshComponent (core.js:8326)
at refreshChildComponents (core.js:6965)
at refreshView (core.js:7222)
at refreshEmbeddedViews (core.js:8280)
in my angular.json file I have added the: "scripts": ["node_modules/chart.js/dist/Chart.js"]
ChartJS version: "chart.js": "^3.0.2", PrimeNG : "primeng": "^11.3.2", Angular CLI v : "@angular/cli": "~10.0.1",
Solution
High probability primeng still only works with v2 of chart.js since v3 just released this month and had some breaking changes.
Downgrading chart.js to version 2.9.4 should resolve your issue
Answered By - LeeLenalee
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.