gpt4 book ai didi

javascript - 调用函数 'ChartModule' ,不支持函数调用

转载 作者:行者123 更新时间:2023-11-28 04:03:01 25 4
gpt4 key购买 nike

我遇到了与 Angular 2 - AOT - Calling function 'ChartModule', function calls not supported 中描述的相同问题

ERROR in Error encountered resolving symbol values statically. Calling function 'ChartModule'. function calls are not supported. Consider replacing the function or lambda with a reference to an exported function.

但就我而言,我有 4 个 require 语句,但我无法让它像上述问题的答案一样工作。

我尝试过,

export function highchartsFactory() {
const hc = require('highcharts');
const hm = require('highcharts/highcharts-more');
const h3d = require('highcharts/highcharts-3d');
const sg = require('highcharts/modules/solid-gauge');

hm(hc);
h3d(hm);
sg(h3d);

return hc;
}

您能否指出我做错了什么以及如何解决这个问题?

谢谢。

最佳答案

我通过将 highcharts 传递给其他模块进行如下更改,使其正常工作。

export function highchartsFactory() {
const hc = require('highcharts');
const hcm = require('highcharts/highcharts-more');
const h3d = require('highcharts/highcharts-3d');
const sg = require('highcharts/modules/solid-gauge');
hcm(hc);
h3d(hc);
sg(hc);

return hc;
}

关于javascript - 调用函数 'ChartModule' ,不支持函数调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46934374/

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