在Meteor 0.7.1.2上,Session变量用于反应性地更改查询结果。当我在浏览器控制台中手动设置Session变量时:
> Session.set('game', 'Tron')
Exception from Deps recompute: TypeError: Cannot read property 'previousSibling' of null
接下来我尝试了以下操作,没有产生任何错误
> Session.set('game', 'Tron')
undefined
接下来我尝试了以下内容,该游戏另一个错误(下面的完整tracestack)
> Session.set('game', 'anotherGame')
Exception from Deps recompute: TypeError: Cannot read property '0' of undefined
造成这些错误的原因是什么?
clientView.js
Template.scores.score = function() {
return Score.find({game: Session.get('game')})
}
错误
Exception from Deps recompute: TypeError: Cannot read property 'previousSibling' of null
at findPosition (http://localhost:3000/packages/liverange.js?710fe06b230e4e9dea26fab955d6a2badb8467cc:210:12)
at new LiveRange (http://localhost:3000/packages/liverange.js?710fe06b230e4e9dea26fab955d6a2badb8467cc:159:18)
at Object.Spark.finalize (http://localhost:3000/packages/spark.js?742c715b73fac26c16ad433118b87045bc5658ff:726:17)
at http://localhost:3000/packages/spark.js?742c715b73fac26c16ad433118b87045bc5658ff:697:13
at LiveRange.operate (http://localhost:3000/packages/liverange.js?710fe06b230e4e9dea26fab955d6a2badb8467cc:490:9)
at http://localhost:3000/packages/spark.js?742c715b73fac26c16ad433118b87045bc5658ff:693:11
at withEventGuard (http://localhost:3000/packages/spark.js?742c715b73fac26c16ad433118b87045bc5658ff:162:16)
at Object.Spark.renderToRange (http://localhost:3000/packages/spark.js?742c715b73fac26c16ad433118b87045bc5658ff:692:3)
at null.<anonymous> (http://localhost:3000/packages/spark.js?742c715b73fac26c16ad433118b87045bc5658ff:925:13)
at Object.Meteor._noYieldsAllowed (http://localhost:3000/packages/meteor.js?2b578107b8239ff9bc64200e6af2a24001461b30:530:10)
和
Exception from Deps recompute: TypeError: Cannot read property '0' of undefined
at LiveRange._removeEntries (http://localhost:3000/packages/liverange.js?710fe06b230e4e9dea26fab955d6a2badb8467cc:384:31)
at LiveRange.operate (http://localhost:3000/packages/liverange.js?710fe06b230e4e9dea26fab955d6a2badb8467cc:479:14)
at http://localhost:3000/packages/spark.js?742c715b73fac26c16ad433118b87045bc5658ff:693:11
at withEventGuard (http://localhost:3000/packages/spark.js?742c715b73fac26c16ad433118b87045bc5658ff:162:16)
at Object.Spark.renderToRange (http://localhost:3000/packages/spark.js?742c715b73fac26c16ad433118b87045bc5658ff:692:3)
at null.<anonymous> (http://localhost:3000/packages/spark.js?742c715b73fac26c16ad433118b87045bc5658ff:925:13)
at Object.Meteor._noYieldsAllowed (http://localhost:3000/packages/meteor.js?2b578107b8239ff9bc64200e6af2a24001461b30:530:10)
at null._func (http://localhost:3000/packages/deps.js?e2b721ea91f036193799d30ccdf652423602aa5c:324:14)
at _.extend._compute (http://localhost:3000/packages/deps.js?e2b721ea91f036193799d30ccdf652423602aa5c:185:12)
at _.extend._recompute (http://localhost:3000/packages/deps.js?e2b721ea91f036193799d30ccdf652423602aa5c:198:14)
检查了重复id
,似乎没有
$('[id]').each(function (i) {
var ids = $('[id="' + this.id + '"]');
if (ids.length > 1) {
console.log(this);
}
return;
}).slice(0,0);