-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enum literals not inserted using Compile on Save, but works with project build. #1916
Comments
looks like a duplicate of #1742, can you try to build the latest bits from the master and check if this issue can still be reproduced? |
@vladima Yeah sorry, I found the other issues after I had posted. I've built from the master and substituted in the resulting typescriptServices.js, but then I get this error when I try and open any ts file in VS2013: API version mismatch: managed version '0.4', script version '0.5' |
You can try to rollback to the revision prior to this commit (394d6f4) that has bumped the version - it should already contain the fix of the enum issue |
Thanks @vladima. For anyone else wanting the correct typescriptServices.js file (pre-compiled), you can find it here: https://dl.dropboxusercontent.com/u/14232632/typescriptServices.js |
@mrcrowl do you still see the issue with updated typescriptServices.js ? |
@vladima, the issue appears to have been fixed in the updated typeScriptServices.js |
great to hear that! |
Since TypeScript 1.4, using the Compile on Save feature, enum members are not being replaced with their literal values in the output js file.
The same operation via a full project build inserts the literal value as expected. This occurs for both regular and const enums.
In the linked example project, there is an enum file "Animals.ts" which is being AMD-imported into the class file "Farm.ts". If you make a minor edit to the Farm.ts file (e.g. insert a space and save), then line 4 of Farm.js shows:
Whereas, if you do a project build, the line 4 of Farm.js shows the expected output:
Example project: https://www.dropbox.com/s/xc34f0q6rhc0amm/ExampleProject.zip?dl=0
I can confirm that this is happening in both VS2013 + TS1.4 and VS2015 CTP.
The text was updated successfully, but these errors were encountered: