iron router - Meteor Tracker error after multiple routes -


when running particular route, i'm getting error (see below), if i've run 1 or more other routes before running one. doesn't matter other routes are. if reload home page, , click route, no error. if reload home, go other route, , 1 in question, error:

exception tracker recompute function: undefined debug.js:43 error: {{#each}} accepts arrays, cursors or falsey values. @ badsequenceerror (http://localhost:3000/packages/observe-sequence.js?hash=550c39b36ab0e65194ea03cdc7ecbe99dcdd07f6:174:10) @ http://localhost:3000/packages/observe-sequence.js?hash=550c39b36ab0e65194ea03cdc7ecbe99dcdd07f6:139:17 @ object.tracker.nonreactive (http://localhost:3000/packages/tracker.js?hash=f525263111eb9d90f4ce1ad064f97aca4a6c1b07:631:12) @ http://localhost:3000/packages/observe-sequence.js?hash=550c39b36ab0e65194ea03cdc7ecbe99dcdd07f6:116:15 @ tracker.computation._compute (http://localhost:3000/packages/tracker.js?hash=f525263111eb9d90f4ce1ad064f97aca4a6c1b07:339:36) @ new tracker.computation (http://localhost:3000/packages/tracker.js?hash=f525263111eb9d90f4ce1ad064f97aca4a6c1b07:229:10) @ object.tracker.autorun (http://localhost:3000/packages/tracker.js?hash=f525263111eb9d90f4ce1ad064f97aca4a6c1b07:604:11) @ object.observe (http://localhost:3000/packages/observe-sequence.js?hash=550c39b36ab0e65194ea03cdc7ecbe99dcdd07f6:113:31) @ . (http://localhost:3000/packages/blaze.js?hash=ef41aed769a8945fc99ac4954e8c9ec157a88cea:2763:43) @ firecallbacks (http://localhost:3000/packages/blaze.js?hash=ef41aed769a8945fc99ac4954e8c9ec157a88cea:1955:26) undefined

my router code:

router.route('/exercises', {      name: 'exercises',      waiton: function() {      this.exercisessub = meteor.subscribe('exercises');      this.progresssub = undefined;        if (meteor.userid() && meteor.user() && meteor.user().emails[0].verified) {        this.progresssub = meteor.subscribe("progress", meteor.userid());      }        return [this.exercisessub, this.progresssub];    },      data: function() {        if (this.exercisessub.ready()) {          if (this.progresssub === undefined || this.progresssub.ready()) {            var data = {            subheader: 'exercises',            exercises: exercises.find({}, {sort: {order: 1}}),          };            if (this.progresssub !== undefined) {            data.progress = progress.findone({});          }            return data;        }      }    }    });

my html:

<template name="exercises">          {{#each exercises}}          <exercise id="{{_id}}">          <h2>{{name}}</h2>          <completedbox></completedbox><completedbox></completedbox><completedbox></completedbox>          <description>{{description}}</description>          <criteria>criteria: <b>{{criteria}}</b></criteria>          highest score: <score>0%</score>          {{>button name="launch" text="launch"}}        </exercise>          {{/each}}    </template>

the returned collection exercises contains same data or without error, reason meteor doesn't see data if i've loaded previous routes. ideas?


Comments