encountered some weird behaviour. when i have a task with id “0” the component does not seem to handle this.
I had a very big hierarchical dataset, the reported error was “Error: Invalid tasks tree. Cyclic reference has been detected on task Location 0”
Changing that specific id solved the issue.
Hello,
In Gantt, id = 0
is reserved as the default value for gantt.config.root_id
, which defines the virtual root of the task tree.
If you assign a task id: 0
, and its parent
is also 0
(the default root), the task becomes its own parent — causing a cyclic reference error:
Error: Invalid tasks tree. Cyclic reference has been detected on task 0
You can either:
- Avoid using
id = 0
;
- Or change the root ID:
gantt.config.root_id = "root";
Here is an example: DHTMLX Snippet Tool