The snippet you use relies on the
addTaskLayer method which is available in PRO versions only.
Looks like you’re using a free GPL edition of gantt, which does not have it. That would explain the error you see.
If you have a paid license, you’ll need to replace a free version of gantt with a PRO version in your project.
Currently, we don’t provide npm install for PRO version, so adding a PRO version of gantt to the project would take a couple of manual steps, please check this article on how to do it https://docs.dhtmlx.com/gantt/desktop__install_with_bower.html#addingproeditionintoproject
Another solution I could advise you is to use the custom vertical drag
addTaskLayer method, like this one: http://snippet.dhtmlx.com/7c6fcda72
In this topic you can read more about custom vertical drag and drop solutions:
Vertical drag and drop from the gantt chart area