highcharts-react icon indicating copy to clipboard operation
highcharts-react copied to clipboard

Error when loading Boost module

Open bferreira opened this issue 6 years ago • 2 comments

Not sure if this should be here our on the Highcharts repo, but I am trying to use Boost module with Highcharts and highcharts-react-officia. l get the following TypeError image

I think I am doing the imports correctly


import * as Highcharts from 'highcharts';
import HighchartsReact from 'highcharts-react-official';
import HighchartsBoost from 'highcharts/modules/boost';

HighchartsBoost(Highcharts);

And I am using NextJS Any pointers that I can try? could I be missing something on my Typescript settings.

bferreira avatar Sep 28 '20 13:09 bferreira

This was happening because boost module cannot be compiled on the server side. I solved it by:

if (typeof window !== 'undefined') {
  HighchartsBoost(Highcharts);
}

And it still didn't work because I was setting the type of curve "Spline" on the series and only works with "line"

bferreira avatar Sep 29 '20 07:09 bferreira

Hello @bferreira,

Thank you for contacting us.

I tried to reproduce your issue and seems that everything works as it should be without any additional checking/condition which you have added. Take a look at this demo: https://stackblitz.com/edit/react-2x36qh?file=index.js

And it still didn't work because I was setting the type of curve "Spline" on the series and only works with "line"

In the documentation, you can find information that:

Including modules/boost.js will, by default, activate boost for all series that support it (line series, column, bar, treemap, heatmap, scatter, bubble, area).

Which means that "Spline" series is not supported. More: https://www.highcharts.com/docs/advanced-chart-features/boost-module

Basts avatar Sep 29 '20 07:09 Basts