Datatables Error when using destroy(): Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted
<p>How I use <strong>DataTables</strong>:</p>

<ol>
<li>Fetch data from the db.</li>
<li>Convert the data to row objects using <strong>Underscore.js</strong> template.</li>
<li>Populate my table's <code>&lt;tbody&gt;</code> with the rows.</li>
<li>Then I init the Datatable on the table that I have.</li>
</ol>

<p>The problem is when I try to add more rows to the table, I am not using the API so I just add rows directly to the <code>&lt;tbody&gt;</code> and I want DataTables to <strong>ReInit</strong> it self using the new <code>&lt;tbody&gt;</code>.</p>

<p>I am trying to <a href="https://datatables.net/reference/api/destroy()" rel="nofollow noreferrer">Destroy</a> the table, but what happens is that I get this error:</p>

<blockquote>
  <p>Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The
  node before which the new node is to be inserted is not a child of
  this node.(…)</p>
</blockquote>

<p>I created a <a href="https://plnkr.co/edit/guXUsqah2p7TpnsjQVBo?p=preview" rel="nofollow noreferrer">Demo</a> to reproduce what I am trying to do using Datatables but it doesn't reproduce the error...</p>

<p>Here is a question I found about the same error:<br>
<a href="https://datatables.net/forums/discussion/28081/how-to-update-table-when-dom-changes-destroy-init-crash" rel="nofollow noreferrer">https://datatables.net/forums/discussion/28081/how-to-update-table-when-dom-changes-destroy-init-crash</a></p>