Closed vulkanino closed 8 years ago
By using NodeJs.Timer
you're resourcing on the IDE builtin runtime to perform the transpilation, which probably leverages a more up to date version of the TypeScript compiler.
Please make sure you're have the latest version (v1.8) of the TypeScript compiler installed in your system. Older compiler versions have proved to have issues like the one you just raised.
I have tsc latest version: 1.8.10. I don't understand this different behavior.
I set up a tasks.json in VS Code and now it doesn't complain anymore!
Tried the example at page 72:
But the TypeScript compiler in the VisualStudio Code complains that setInterval does not return a number:
I had to modify the id declaration to:
intervalId: NodeJS.Timer;
and it compiles in the IDE but doesn't with tsc. I don't get it, what is the compiler difference between the IDE and the tsc command line?
I've checked the Nodejs docs for setInterval and:
intervalObject is not a number, in fact in the console if I print out the intervalId I get a... ZoneTask?
I'm too confused.