没用next.js,在react使用写法:
import Highcharts from 'highcharts';
import highcharts3d from 'highcharts/highcharts-3d'
highcharts3d(Highcharts);
服务器端按照上述的写法会报
Cannot read property 'parts/Globals.js' of undefined
在next.js服务端渲染正确写法:
import Highcharts from 'highcharts';
import highcharts3d from 'highcharts/highcharts-3d'
if (typeof Highcharts === 'object') {
highcharts3d(Highcharts);
}