TypeScript 1.4 does not work in VS 2013 Update 4
The following, when present in a .ts file in any Visual Studio 2013 Update 4 project will generate an error. That error is immediately visible if Web Essentials 2.5.4 is installed, otherwise you won't see it until you examine the generated .js file:
const enum Color { Blue, Green, Red };
I've verified the following:
- Right-click project, Properties, TypeScript Build: EcmaScript version : I've tried all three choices, none of which prevent the error: EcmaScript3, 5 or 6.
- Unloaded the project, Edit, verified the following line is present: TypeScriptToolsVersion 1.4 TypeScriptToolsVersion
(note: had to remove HTML markup from this issue text comment; otherwise, the entire line disappears upon save of this issue text)
3. There is a directory on the computer at the following location:
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.4
in that directory is a tsc.exe with the following properties:
File Version 1.4.0.40115
Product Version: 1.4.0.40115
What is the actual error you're seeing? In the Playground: http://www.typescriptlang.org/Playground#src=const%20enum%20Color%20%7B%20Blue%2C%20Green%2C%20Red%20%7D%3B
If I type the following in the Playground: const enum Color { Blue, Green, Red }; var c : any = Color[Color.Blue];
The right hand screen looks like this: ; var c = Color[0 /* Blue */];
If I change the left side to this (drop back to older TypeScript syntax): enum Color { Blue, Green, Red }; var c : any = Color[Color.Blue];
The right side looks like this: var Color; (function (Color) { Color[Color["Blue"] = 0] = "Blue"; Color[Color["Green"] = 1] = "Green"; Color[Color["Red"] = 2] = "Red"; })(Color || (Color = {})); ; var c = Color[0 /* Blue */];
Even the playground doesn't support TypeScript 1.4. Is it any wonder that Visual Studio 2013 Update 4 doesn't support TypeScript 1.4 either?
I hope a patch comes out soon.
The Playground is currently running TypeScript 1.4, the bits for VS2013 are here https://visualstudiogallery.msdn.microsoft.com/2d42d8dc-e085-45eb-a30b-3f7d50d55304
The behavior you're describing for enum emit is exactly as intended. const enum is a new feature, distinct from non-const enums which still exist.
@danquirk the link in your comment gives an error.
If you see this page, it is because an error occurred in the system while trying to process your request. We apologize for the inconvenience. This error has been reported to our team for analysis.
@GaryB432 I assume you're referring to the VS gallery link. It works for me at the moment, is it still broken for you? Maybe a temporary hiccup.
Yes the VS gallery link. I am still seeing this..
If you see this page, it is because an error occurred in the system while trying to process your request. We apologize for the inconvenience. This error has been reported to our team for analysis. Error Log Reference #450fea7e-76cc-4478-a0c3-c08f2d841862
Now I've tried searching and clicking within the gallery itself and that error comes up on every item I click, except with a different GUID.
Thanks for looking
Very odd, I've sent mail to the appropriate folks to make sure they're looking into it in case the automated reporting system isn't sufficient.
I am wondering if you are able to access other extensions on the VS Gallery?
thanks
I was not able to access anything in the gallery using Chrome. I tried in IE11 and it seems to work. I am now downloading 1.4 for VS2013!
I am not able to use Typescript 1.4 in Visual Studio 2013 Update 5 and it always throws the build error. I verified my installed version and i have 1.4 and 1.5, the path in environment variable is updated to 1.4, the typescriptversion is the VS proj is also set to 1.4. I dont know what else is missing for it to work. Appreciate your input

does compiling on the commandline works for you? does the files you have contain any newer syntax that was introduced in newer versions of the language (e.g. union types was introduced in 1.5, intersection types in 1.6, and this types in 1.7, etc..) ? can you provide a sample file that is causing you the build errors?
No, the compiling command line also doesnt work and it gives error "let" can be used on ecma 6 and above. All i have done is created a visual studio project and added nuget packages for angularjs.TypeScript.DefinitelyTyped.6.1.0 and jquery.TypeScript.DefinitelyTyped.3.0.5, which automatically creates a typings folder. I created a Learning.ts file outside the folder. The build error is from all the files that have been added from nuget angular package like angular.d.ts, angular-resource.d.ts
@kspranesh let is a new syntax introduced in TS 1.5, so it is an error in prior versions. if you want to use a library (angular) that uses the new syntax, you need to update to a newer version of the tools.
here is the link for VS 2013 installer for TS: https://www.microsoft.com/en-us/download/details.aspx?id=48739