-
Notifications
You must be signed in to change notification settings - Fork 12.8k
VS 2013 save and compile output vs build compile output #1812
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
Comments
Can you try the latest bits from master? It seems that root cause of this issue is the same with #1742 that was recently fixed |
What and where do I need to replace? Sent from my Windows Phone From: Vladimir Matveevmailto:[email protected] Can you try the latest bits from master? It seems that root cause of this issue is the same with #1742 that was recently fixed Reply to this email directly or view it on GitHub: |
|
I've been getting this in |
@vladima A new copy of typescriptServices.js seems to have fixed the issue when i mark the enum declaration in the d.ts file as a const enum, but not for the scenario in which the enum is not a const enum. |
I've tried the new copy of typescriptServices.js and for me the problem still exists. It seems to work about 50% of the time when saving but in the other 50% it still compiles to the enum string (ex. server.Colors.Red in craigs example) |
In my case, I want it to compile to a constant since it is declared in a declaration file and they're isn't an implementation of the enum. Sent from my Windows Phone From: Stompfmailto:[email protected] I've tried the new copy of typescriptServices.js and for me the problem still exists. It seems to work about 50% of the time when saving but in the other 50% it still compiles to a constant Reply to this email directly or view it on GitHub: |
Yea I mixed up the words :) What I mean is that the output still sometimes is wrong like "server.Colors.Red" instead of "0 /* Red */" in your example for me when I save in VS 2013 even with updated typescriptServices.js. Tried edited my previous comment to reflect that |
Can you write a short video with repro using Screen2Gif or similar tool? If you can please also capture the structure of the virtual project in Solution Navigator and set of files at the top of the screen |
Hello! I tried building the latest master again and now it works, I think I did something wrong the first time (sorry first time building from master). So you can disregard me. |
@craigktreasure can you please provide a video with repro that will involve non const enums? |
@vladima I'll send a sample project your way later today. |
This looks the same as the issue I'm having in #1916. Example project: https://www.dropbox.com/s/xc34f0q6rhc0amm/ExampleProject.zip?dl=0 |
@vladima I believe this is fixed now. |
I have replaced typescriptServices.js file and now on save it does not generate any file and console sys: "Input file contained syntax errors. Output generation skipped." I do not have any errors and on build everything works fine. |
Can you share a sample file where you are wrong this? |
I dont know whic file exactly because after i pased same code to clean project it compile. However build passes with no errors. Console does not show anything on save except that error. |
The issue would probably be linked to the contents of your project, it would help a lot if you can detect the code pattern that consistently triggers the issue. |
Hello again, I have found problem.
in my proj file and props file contains this line:
if I remove it everything compiles fine. p.s. off topic: mshould i update ToolsVersion="4.0" in same file because of typescriptservices.js file changed? p.p.s. one more offtopic question which i cannot find clear answer on the web - shuold i use delegate or method syntax in classes. In ecma6 there is methods syntax but delgates generates better javascript and prevents overriding. so:
|
Use method syntax, since it will be initialized once on the prototype. The property initializer will be set in the constructor body and a new closure may be created once per instantiation. |
Ok. What about my main problem about compilation problem of typescript with props set? |
There is nothing to share actually. Have you tried to add line I pasted before? Because as I mentioned before it stops to compile when this import is in .proj file
because of this line in that import
if you add to empty web project you should be able to reproduce it. |
@vytautas-pranskunas- what kind of web project are you using. i am still not able to repro this issue with the different projects i tried. |
I am doing it with empty MVC Web project. |
Vs2013. Its not only for me, its for all the team. Are you replacing only typescriptservices.js or something more? |
can you give TypeScript 1.5-Beta on VS2013 a try? it was just released :) |
I defenetly will. Whats the best way to install it? |
1 similar comment
I defenetly will. Whats the best way to install it? |
Here is the announcement: http://blogs.msdn.com/b/typescript/archive/2015/04/30/announcing-typescript-1-5-beta.aspx here is the installer for VS2013: https://visualstudiogallery.msdn.microsoft.com/107f89a0-a542-4264-b0a9-eb91037cf7af and the installer for VS2015 RC: https://visualstudiogallery.msdn.microsoft.com/3e5ba71c-abea-4d00-b81b-a62de3ad3d53 |
How this affects my MsBuild task? I mean I will have to update to 1.5 TS my CI server wouldn't I? I wonder can beta cause any problems to enterprise app build process? |
The TypeScript targets have a property that specify which version of the compiler to use. <TypeScriptToolsVersion>1.4</TypeScriptToolsVersion> if your project states Installing the beta on production environments is up to your organizational policies. What i am looking for is to get a way to reproduce the issue you are running into to be able to diagnose it. It would be great if you can try the same project with same setup on 1.5 to see if the problem still exists. |
I have tried 1.5 beta: |
Seems like after uninstalling 1.5 and re-installing 1.4 everything worked until vs restart. Now i get error when trying to build project because of incorrect typescript path Microsoft SDKa\TypeScript\1.4\1.4\tsc.exe I was able to fix it but only by replacing TypeScript.dll taken from coworker in C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript folder (uninstalling, re-installing and repairing did not helped). Looks like path was hard-coded in that .dll which might not be the best idea. |
Can you share your install logs: %TEMP%\dd_TypeScript_* |
Could you write full path to folder please? |
well.. it depends where your temp folder is.. try:
mine is at: C:\Users\mhegazy\AppData\Local\Temp |
Give me an email where to send zip please |
mhegazy at microsoft |
We were still trying to fix that enum issue with cooworkers.
Can you try to put enums in definition file and use it other file's class and then do compile on save. |
so you are still on 1.4? or have you managed to updated to 1.5? The issue did exist with 1.4, and we believe it has been fixed in 1.5. |
It took me some digging to find the fix that was made, so here it is if anyone else also needs to patch their 1.4 typescriptServices.js: 4d14e97 It's on line 18265. |
@mhegazy I am hitting this again with the VS 2015 RTM and TS 1.5 with my project targeting 1.5. Enum definitions are not converted to constants. Any thoughts? |
are they regular enums or const enums? can you share a repro? |
They are regular enums. Same repro as the first post when i opened this issue. Workaround is to mark the enum as a const enum in the definition, but that shouldn't be necessary. |
this is breaking change in TypeScript 1.5:
|
Ouch. Good to know. I wish there had been a link to those in the 1.5 announcement post. If it was, i missed it. |
Good point. Will do that next release. we usually put it in the release notes: https://github.com/Microsoft/TypeScript/releases/tag/v1.5.3 |
I have an enum in an interface that, when used in my TS code in TypeScript 1.3, was output as a constant. This is no longer the case in 1.4 after saving my file. When i build the project, the enum code is properly output as a constant. Using VS 2013 update 4 with TypeScript 1.4 installed.
Enum declaration file (Colors.d.ts):
TS Code:
JS Output after save:
JS Output after build (correct, or what i consider to be correct since there is no implementation of the enum):
The same is observed if the enum is declared using the new "const enum" feature.
The text was updated successfully, but these errors were encountered: