Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Can't set timers inside simulations #4

Closed
maxnowack opened this issue Jun 23, 2015 · 5 comments
Closed

Error: Can't set timers inside simulations #4

maxnowack opened this issue Jun 23, 2015 · 5 comments

Comments

@maxnowack
Copy link

Callstack:

Error: Can't set timers inside simulations
    at withoutInvocation (timers.js:5)
    at bindAndCatch (timers.js:13)
    at Object._.extend.setTimeout (timers.js:29)
    at Object.SubsCache.SubsCache.subscribeFor.cachedSub.delayedStop (subsCache.coffee:89)
    at subsCache.coffee:85
    at tracker.js:263
    at Object.Tracker.nonreactive (tracker.js:560)
    at Tracker.Computation.invalidate (tracker.js:262)
    at Tracker.Computation.stop (tracker.js:279)
    at null.<anonymous> (view.js:203)
@ccorcos
Copy link
Owner

ccorcos commented Jun 23, 2015

Can I get some context? "inside simulation" makes me think something is happening in a Meteor.method...

@maxnowack
Copy link
Author

I start the subscription in a Template.onCreated() (inside this.autorun()) function, to get cached template level subscriptions. If the data for the template instance get removed, the template will be destroyed. The error occurs on destroying the template

@maxnowack
Copy link
Author

Here's a MeteorPad: http://meteorpad.com/pad/MwuA7rasNrd2SGpxN/ccorcos:subs-cache#4
I hope it's okay for you that I used coffeescript.

The error occurs if you click the "x" to remove a player

@ccorcos
Copy link
Owner

ccorcos commented Jun 25, 2015

Hmm. I've never used Template.currentData() but I think thats the issue.

This works:

http://meteorpad.com/pad/FvHmens47jwYLrgrN/Copy%20of%20ccorcos:subs-cache#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants