addTaskLayer is not a function

I’m trying to add div using addTaskLayer but it is showing gantt.addTaskLayer is not a function
TypeError: gantt.addTaskLayer is not a function

Hello Katravath,
The addTaskLayer method is only available in the Pro and Trial versions:


So, if you see that error message, it means that you didn’t install the Pro and Trial version in your project.

You can install Gantt as an NPM package the following way:

  1. Unpack Gantt to a specific folder, for example, to /opt/gantt_pro
  2. Use the following command to install Gantt:
npm install /opt/gantt_pro

You can read more about installation methods in the following article:
https://docs.dhtmlx.com/gantt/desktop__install_with_bower.html#addingproeditionintoproject