addTaskLayer getVisibleRange

Hello team.
Since version 8.0.9 of dhtmlx gantt, the addTaskLayer function does not work properly. The renderer requires us to provide a getVisibleRange function - I cannot skip it. The documentation and the types file says that I can return undefined or void, but if I try to, it doesn’t work properly.

I checked some existing snippets - DHTMLX - Gantt. addTaskLayer: Show vertical line from the milestone to the top ("renderer", "getRectangle", "getVisibleRange" functions) and even they have script errors and don’t work.

It seems to be a bug in Gantt. Thank you for letting us know about that! In the 8.0.9 version, the dev team added something different to check the range, but it is working correctly on the initial load only. I will add it as a bug to our internal bug tracker, and the dev team will fix it in the future updates.
Now, as a workaround, you need to return an object that contains all task IDs:

getVisibleRange: function (gantt, view, config, datastore, viewport) {
  return {ids: datastore.fullOrder};
},

Here is the updated snippet:
https://snippet.dhtmlx.com/czulc94e

Hi,
I’m trying this in v9.0.1 and it is still not working, I’m getting a type error.
This is how the type is defined:
getVisibleRange: ((
gantt?: GanttStatic,
view?: any,
config?: GanttConfigOptions,
datastore?: any,
viewport?: AdditionalTaskLayer[“LayerViewport”],
)=> {start: number, end: number} | undefined | void ),

Hello Odiya,
The bug with the getVisibleRange should be fixed in the 8.0.11 version:
https://docs.dhtmlx.com/gantt/whatsnew.html#:~:text=Fix%20the%20error%20thrown%20by%20Gantt%20when%20defining%20a%20custom%20getVisibleRange%20function

So, now, you don’t need to return anything there.
I updated the snippet, and don’t see any errors:
https://snippet.dhtmlx.com/czulc94e