Closed VanDalkvist closed 8 years ago
I do not have error. My version of global tsc:
>tsc -v
Version 1.8.9
However source are built using local \it-depends\node_modules\typescript module.
The version of typescript in \it-depends\node_modules\typescript\package.json
is "version": "1.8.7"
It should be the same as mine for you when you execute npm install
in your local repository.
Union types were introduced in 1.4: https://blogs.msdn.microsoft.com/typescript/2014/11/18/typescript-1-4-sneak-peek-union-types-type-guards-and-more/
Don't know why I have the error there. I use WebStorm and it has 1.8.7 version of typescript like from local node_modules repository. With VisualStudio typescript comes with 1.0.3.0 version. Weird. I doubt that WebStorm uses 1.0.3.0 version.
Nevertheless,
> tsc -v
1.0.3.0
Try updating typescript. As I rememeber it is done with npm install typescript -g
However you should use gulp to build project I think. At the least I do o from VSCode (see https://github.com/gerich-home/it-depends/blob/master/.vscode/launch.json#L8 or https://github.com/gerich-home/it-depends/blob/master/.vscode/tasks.json#L10)
I've already tried to update. Also I've updated VS typescript but it didn't turn on to the new version. And Of course I use gulp to build. In any case it is environment issue, so, I will close the issue.
And also I should say that build ts is always successful. So, another sign that it's IDE or environment issue
I have typescript lint error in https://github.com/gerich-home/it-depends/blob/master/src/computed.ts#L153 line (
ISubscription is not assignable to type {Function, Function}
).Actually, I don't have experience in TypeScript language. But after a little investigation I found that
line is cause of the error. So, here is union operator with different constructors. So, my question is: Does it depend on version of TypeScript? Do you have an error there like me?