I had experienced the same error! What fixed it for me was changing the target in the dataTable initialization based on the number of columns starting from 0.
In our table we had 4 columns so targets: [3]
$.extend($.fn.dataTable.defaults,{
columnDefs: [{
targets: [3]
}]
});