Is most probably because the node (first parameter) that you want to insert in DOM is null or undefined. You can reproduce this error by running:
You must check the line that returns the element reference to
document.querySelector('.dragging') // must be not null, you can run in console and/or debug using the devtools to see what is happening
CLICK HERE to find out more related problems solutions.