高图:无法读取未定义的属性“ parts / Globals.js”

Shi*_*ari 3 javascript undefined highcharts

我正在使用Highcharts的某些库,但出现以下错误:

Uncaught TypeError: Cannot read property 'parts/Globals.js' of 
undefined
at map.src.js:31
at map.src.js:22
at map.src.js:11
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?我在用:

<script src="https://code.highcharts.com/maps/modules/map.js"></script>
Run Code Online (Sandbox Code Playgroud)

Joh*_*edy 9

如果遇到此错误,您可能需要检查您的应用程序是否不是服务器渲染的。如果是服务器渲染的,则以下内容应该可以解决问题:

检查 highcharts 是否为 类型'object',因为在服务器上它的类型为'function'。如果它是一个对象,那么您想要执行您想要的模块。请看下面:

import Highcharts from 'highcharts/highcharts';
import HighchartsReact from 'highcharts-react-official';
import highchartsBellCurve from 'highcharts/modules/histogram-bellcurve';

if (typeof Highcharts === 'object') {
  highchartsBellCurve(Highcharts); // Execute the bell curve module
}
Run Code Online (Sandbox Code Playgroud)


Vis*_*lur 6

面临同样的问题。Highcharts 两天前发布了新版本7.1.0。他们已修复导致此错误的问题(10232)。您可以使用https://code.highcharts.com/5.0.14/modules/solid-gauge.js此特定版本,而不是最新版本。现在为我工作。