Deps.autorun(function() {
var locale = Session.get('locale');
if (locale)
emit('result', locale);
});
Sometimes it returns the correct answer, but usually I get:
[Error on Client] TypeError: 'undefined' is not an object (evaluating 'history.state.initial')
I'd say 4/5 times it fails with that error. I just keep rerunnning and I get a few passes here and there. Interestingly, if I use emit('result', 1) in the same location, the 1 always goes through (so not a timing issue). Any other variable gives the same problem (even if I set var x=1 in the function and try return it).
Hey. This is my first test, so go easy on me :)
I have something like this:
Sometimes it returns the correct answer, but usually I get:
I'd say 4/5 times it fails with that error. I just keep rerunnning and I get a few passes here and there. Interestingly, if I use
emit('result', 1)
in the same location, the 1 always goes through (so not a timing issue). Any other variable gives the same problem (even if I setvar x=1
in the function and try return it).Any ideas?