When leaflet (1.5.1) has removed a layer from the map it calls "onRemove" on the layer.
Therefore all subclasses should implement a "onRemove" method.
See https://github.com/Leaflet/Leaflet/blob/master/src/layer/Layer.js lines 121-130
Unfortunately, the HarpGL layer is missing the onRemove method and therefore an error is thrown at the leaflet (Layer.js) call in line 185: onRemove is not a function.
This happens when harpGL.removeFrom(map) is called.