gpt4 book ai didi

angular - 核心.js :4197 ERROR TypeError: chart_js__WEBPACK_IMPORTED_MODULE_2__ is not a constructor

转载 作者:行者123 更新时间:2023-12-03 17:50:15 24 4
gpt4 key购买 nike

我在使用 chartJS 和 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)
在我的 angular.json 文件中,我添加了:
“脚本”:[“node_modules/chart.js/dist/Chart.js”]
ChartJS 版本:"chart.js": "^3.0.2",
PrimeNG : "primeng": "^11.3.2",
Angular CLI v:“@angular/cli”:“~10.0.1”,

最佳答案

高概率primeng仍然只适用于chart.js的v2,因为v3本月刚刚发布并且有一些突破性的变化。
将 chart.js 降级到 2.9.4 版应该可以解决您的问题

关于angular - 核心.js :4197 ERROR TypeError: chart_js__WEBPACK_IMPORTED_MODULE_2__ is not a constructor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67008242/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com