Unable to use the treemap.js module with highcharts V11.4

There’s a specific graph I need called a ‘treemap with a colour axis’ which requires two modules. treemap.js and heatmap.js.

I’ve tried a few different methods but I keep getting strange errors when I try to include them in my project such as:

TypeError: Cannot read properties of undefined (reading ‘indexOf’)
at pushUnique (script?v=vX17qqiPDxzKs18Nj2Vt_4PDjBMkk_DMrxvt8ZpUlvY1:47720:323)
at x.compose (treemap.js:8:2115)
at treemap.js:8:25053
at i (treemap.js:8:368)
at treemap.js:8:24845
at treemap.js:8:219
at treemap.js:8:271

I’ve tried including both modules when it lazy loads the page:

lazy: [‘$ocLazyLoad’, function ($ocLazyLoad) {
return $ocLazyLoad.load([{
name: ‘HerdManagementWeb’,
files: [
‘https://code.highcharts.com/modules/heatmap.js’,
‘https://code.highcharts.com/modules/treemap.js’,
url(“/version/resource?path=~/bundles/milkcomposition&ext=.js”)
]
}]);
}]

The treemap file was just the Highcharts module relabeled.

I’ve also tried downloading the modules myself and including them in the pages bundle:
scriptBundle.Include(“~/Scripts/libraries/highcharts11/heatmap.js”);
scriptBundle.Include(“~/Scripts/libraries/highcharts11/treemap.js”);

Same problem as before, treemap is the wrong file.

I figured maybe treemap is already included in the highcharts module, so I removed the treemap.js module and it complains that I don’t have treemap:

Error: Highcharts error #17: www.highcharts.com/errors/17/?missingModuleFor=treemap

  • missingModuleFor: treemap

So if it won’t let me download the correct file, it won’t load it via the direct link provided by HighCharts in their own documentation and treemap is not included in the HighCharts module, what am I supposed to do?