If you encounter this error, you might want to check that your app is not server rendered.
In the case that it is server rendered then the following should fix the issue:
Check that highcharts is a type of 'object'
, because on the server it is of type 'function'
. If it is an object then you want to execute the module you want. Kindly see below:
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
}