title: Meteor Deps Recompute Fails
body: <p>Clicking the previous button will retrieves the previous date's collections. For example, if the current date is 2013-04-05, then the previous button will retrieve all collections for 2013-04-04, and so on. However, the automatic update does not works. The new collection of events never did appears and an exception occurs.</p>
  <p>Additionally, I have also run into this error if I tries to create a new event. Only by refreshing the page do I see the new event in the collection.</p>
  <h2>Error</h2>
  <pre><code>Exception from Deps recompute: Error: Error copying attribute ',': Error:     InvalidCharacterError: DOM Exception 5
  at Function.Spark._Patcher._copyAttributes (http://0.0.0.0:3000/packages/spark/patch.js?   e76412b922e47b6c2c1f890e3bc10fd13bdecfef:494:19)
  at Spark._Patcher.match (http://0.0.0.0:3000/packages/spark/patch.js?e76412b922e47b6c2c1f890e3bc10fd13bdecfef:249:26)
  at http://0.0.0.0:3000/packages/spark/patch.js?e76412b922e47b6c2c1f890e3bc10fd13bdecfef:61:23
  at visitNodes (http://0.0.0.0:3000/packages/spark/patch.js?e76412b922e47b6c2c1f890e3bc10fd13bdecfef:17:11)
  at Object.Spark._patch (http://0.0.0.0:3000/packages/spark/patch.js?e76412b922e47b6c2c1f890e3bc10fd13bdecfef:31:3)
  at http://0.0.0.0:3000/packages/spark/spark.js?4af332696fb84f1c71f2e678ad0a267755b2b828:638:13
  at LiveRange.operate (http://0.0.0.0:3000/packages/liverange/liverange.js?5e6bc5ba11645802c3440658c75fcc2277537dd1:458:9)
  at http://0.0.0.0:3000/packages/spark/spark.js?4af332696fb84f1c71f2e678ad0a267755b2b828:633:11
  at withEventGuard (http://0.0.0.0:3000/packages/spark/spark.js?4af332696fb84f1c71f2e678ad0a267755b2b828:103:16)
  at Object.Spark.renderToRange (http://0.0.0.0:3000/packages/spark/spark.js?4af332696fb84f1c71f2e678ad0a267755b2b828:632:3) logging.js:40
  
  Exception from Deps afterFlush function: TypeError: Cannot read property 'previousSibling' of null
  at findPosition (http://0.0.0.0:3000/packages/liverange/liverange.js?5e6bc5ba11645802c3440658c75fcc2277537dd1:177:12)
  at new LiveRange (http://0.0.0.0:3000/packages/liverange/liverange.js?5e6bc5ba11645802c3440658c75fcc2277537dd1:126:18)
  at notifyWatchers (http://0.0.0.0:3000/packages/spark/spark.js?4af332696fb84f1c71f2e678ad0a267755b2b828:86:19)
  at http://0.0.0.0:3000/packages/spark/spark.js?4af332696fb84f1c71f2e678ad0a267755b2b828:404:5
  at _.extend.flush (http://0.0.0.0:3000/packages/deps/deps.js?651e87591167f4286e96438ff2566ba3357bff99:231:11) 
  </code></pre>
  <h2>Code for finding a list of events, the code under the else is the relevant part</h2>
  <pre><code>Template.event_manager.list = () -&gt;
     if (Session.get(&quot;events_toggl&quot;))
       Events.find({user_id: Meteor.userId()}, {sort: {seconds: 1}})
     else
       d = Session.get(&quot;eventnav&quot;)
       start = moment().subtract(&quot;days&quot;,d).startOf(&quot;day&quot;)._d
       end = moment().subtract(&quot;days&quot;, d).endOf(&quot;end&quot;)._d
       Events.find({user_id: Meteor.userId(), date: {$gte: start, $lt: end} })
  </code></pre>
  <h2>clicking previous will trigger an update in the list function above</h2>
  <pre><code>'click #previous' : () -&gt;
      d = Session.get(&quot;eventnav&quot;)
      d += 1
      Session.set(&quot;eventnav&quot;, d)
  </code></pre>
  <h2>part where we decide to render a list of events</h2>
  <pre><code>  {{#each list}}
      {{&gt; event}}
    {{/each}}
  </code></pre>
  <h2>template for individual events</h2>
  <pre><code>&lt;template name=&quot;event&quot;&gt;
    &lt;tr class={{status}}&gt;
      &lt;td&gt;{{seconds}}&lt;/td&gt;
      &lt;td&gt;&lt;p id=&quot;date-{{_id}}&quot; class=&quot;date&quot;&gt;{{date}}&lt;/p&gt;&lt;/td&gt;
      &lt;td&gt;&lt;p id=&quot;name-{{_id}}&quot; class=&quot;name&quot;&gt;{{name}}&lt;/p&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type=&quot;button&quot; id=&quot;select&quot; value=&quot;select&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input type=&quot;button&quot; id=&quot;destroy&quot; value=&quot;delete&quot; /&gt;&lt;/td&gt;
    &lt;/tr&gt;
   &lt;/template&gt;
  </code></pre>