I have some strange issue with timers. I’m trying to clear a timeout I set with Meteor.setTimeout.
One issue is that if I do the following on the client and server I get different results:
`console.log(Meteor.setTimeout(function () {}, 100));`
On the server it returns a complex object. On the client it returns a Number. Is this the expected behaviour?
The following test code is working for me on the server it seems:
const handle = Meteor.setTimeout(function () {}, 100);
console.log(handle);
Meteor.clearTimeout(handle);
But when I do the following:
Meteor.clearTimeout(this.timeouts[someId]);
where this.timeouts[someId]
is a timeout handle.
I get the following error:
[TypeError: Cannot assign to read only property '_onTimeout' of BqKqXDcdbDhGP7YKp]
Any idea why this happens or how to fix it?