title: Error: Failed to execute 'insertBefore' on 'Node'
body: <p>I tried to insert <code>&lt;div&gt;</code> containers around the {{#each}} but it didn't work as well. Its also odd because it works for 2 normal posts list pages, but not for the 3rd one which sorts them by distance. </p>
  
  <p><strong>Updates:</strong> 
  I noticed that after i change the template JS from <code>template.name.onRendered</code> to <code>onCreated</code>, the sorting page works. However it works only if you go from a previous post list page and not from the profile page.</p>
  
  <p>The only common ground of the error pages is those pages use publishComposite for sorting. Could that be the issue since publishComposite has a child to parent relationship?</p>
  
  <p><strong>The error message</strong> </p>
  
  <pre><code>Exception in queued task: Error: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
      at Error (native)
      at Object.container._uihooks.insertElement (http://localhost:3000/packages/meteoric_ionic.js?e45c114e85716d9fad8bac1cd7904ae2700bc963:5750:19)
      at DOMRange._insertNodeWithHooks (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:383:21)
      at Function.Blaze._DOMRange._insertNodeWithHooks (http://localhost:3000/packages/peerlibrary_blaze-components.js?4eddb4e3f0f660190548347e680d109a51a7050f:2377:10)
      at Function.DOMRange._insert (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:354:16)
      at DOMRange.attach (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:431:16)
      at Blaze._DOMRange.attach (http://localhost:3000/packages/peerlibrary_blaze-components.js?4eddb4e3f0f660190548347e680d109a51a7050f:2437:33)
      at Function.DOMRange._insert (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:349:7)
      at DOMRange.attach (http://localhost:3000/packages/blaze.js?695c7798b7f4eebed3f8ce0cbb17c21748ff8ba8:431:16)
      at Blaze._DOMRange.attach (http://localhost:3000/packages/peerlibrary_blaze-components.js?4eddb4e3f0f660190548347e680d109a51a7050f:2437:33)
  </code></pre>
  
  <p><strong>The meteoric_ionic js file referred to line 19</strong></p>
  
  <pre><code>container._uihooks = {                                                                                               
      insertElement: function(node, next) {                                                                              
        var $node = $(node);                                                                                             
        if (!template.transition || !$node.hasClass('view') || IonNavigation.skipTransitions) {                         
          container.insertBefore(node, next);  //line 19                                                                          
          return;                                                                                                        
        }  
  </code></pre>
  
  <p><strong>The relevant html</strong></p>
  
  <pre><code>  {{#ionView}}
      {{#ionContent}}
          {{#ionList}}
              &lt;div&gt;
                {{#each shops}}
                      {{&gt; shopItem}}
                {{/each}}
              &lt;/div&gt;
          {{/ionList}}
      {{/ionContent}}
    {{/ionView}}
  </code></pre>