-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Compile on Build / Compile on Save problems with TS 1.8 in Visual Studio 2015 #6782
Comments
the Can you check your tools\options\Text Editor\TypeScript\Project\Compile on Save, do you have "Automatically compile TypeScript files that are not part of a project" checked? my guess is no, and that is why it is not working. with #2326, you should be able to turn it on using |
Yup that solved it. Thanks @mhegazy.I'll look out for |
@mhegazy - I'm guessing with the VS 2015 TypeScript 1.8 beta plugin I shouldn't expect I wanted to ask about building as well but I'll break that out into a separte issue. |
@johnnyreilly Indeed, the |
Thanks @paulvanbrenk. |
Is |
@mythz, tsconfig.json is not supported for Visual Studio 2013. only Visual Studio 2015. |
Seems |
@codler can you share your project? |
@codler which version of TypeScript? We've fixed issues in that area. |
@paulvanbrenk I can repro colder's issue on 1.8.4.0. |
@hcapp01 can you share a repro project. |
@mhegazy |
@hcapp01 change |
@paulvanbrenk that works. thanks. |
@mhegazy, do you know what the status of this is? I'm having trouble getting TS Version: 1.8.9 (says 1.8.31.0 on the Visual Studio {
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"noImplicitAny": true,
"sourceMap": true,
"noEmitOnError": true
},
"compileOnSave": true
} When I build the whole project via When I save a specific Things were working fine before I introduced I tried some of the suggested workarounds including turning off |
The message is somewthing i would expect. it just says it generated how do you build from the commandline? |
@mhegazy, I'm just using Visual Studio. The message "generated foo.js" is also wrong because the file is unchanged. Sent from my iPhone On 9 May 2016, at 00:12, Mohamed Hegazy <notifications@github.commailto:notifications@github.com> wrote: When I save a specific .ts file, the status bar says "Generation of 'myproject/foo.ts' complete. Remaining files still compiling." This just hangs, and the .js output never gets generated. The message is somewthing i would expect. it just says it generated foo.ts and working on generating the rest in the background. but it should not hang. how do you build from the commandline? tsc --p ? or you use a build driver? what happens when you run tsc --p --listFiles do you see files that should not be there? You are receiving this because you commented. |
Given the language semantics, generating one file might not be sufficient to get correct output, e.g. Const. enums changes, namespaces, etc.. In VS when saving a file, the file will be generated, then all other files in the project will be generated in the background one at a time. This should end at sometime though :) so what u are seeing seems like a bug. |
i was seeing something similar. i _believe_ that unloading the project and reloading it seems to have fixed the compile on save that i added to tsconfig.json. maybe it doesn't take effect until the project is reloaded? |
& hello again @mhegazy 😄 |
This looks like a bug to me. @paulvanbrenk thoughts? |
@cmichaelgraham do you mind filing another issue for this? |
and hello @cmichaelgraham, good to see you! |
Not sure, are the other settings in the |
Here's what I don't get: it sometimes works fine and others it doesn't! I can't for the life of me figure out what I'm doing right or wrong when, or if I even have any influence on this at all. It's almost more frustrating to have it work "sometimes" than to just never work. My workaround sucks. Today, it simply doesn't work so I am back to the habit of hitting "Rebuild" every time I make the tiniest change. Please tell me you've found a better temporary workflow/workaround until this is fixed!!! But yesterday it was all unicorns and rainbows. Everything was flowing beautifully in the same solution, same IDE, same computer. No idea what changed. If it works sometimes, maybe there's a tweak to get it to work always? |
Please share your workaroundsI guess this problem has been around for a while now and like me, if you're still pushing through you must have come up with a pattern, habit, workflow, or workaround that is getting you through each day until this is fixed. Mine is to "rebuild" the whole solution every time I make the tiniest change to any .ts file. Surely someone has come up with a better way. Please do tell! |
We found an issue with compile on save and [0] I can't tell you when that will be released, but the RC release has other TypeScript issues, so don't install that. |
I installed the Update 3 RC and it has helped with a lot of other problems but not this one. Most vitally, it made the .tfignore file work, which I absolutely need when committing lots of small typescript files to source control and wanting to ignore the transpiled .js and .map.js files. @paulvanbrenk could you maybe provide a little more detail on the "order we processed files" as I'd like to tinker but honestly don't know what you're talking about. |
I have very similar issues. Everything compiles correctly, but it takes a very long time, and sometimes randomly flakes out. Wasn't like this with the previous version of TSC. |
@gleno this is an old issue. do you mind filing a new issue, sharing more details about what you are seeing, what version of VS you are using what version of TS, and a project to help investigate the issue. |
I'm using VS 2015 Update 3 and are experiencing a very similar issue. The typescript compiler seems to only work when I do a build. However, if I do a build, and no server side code has changed, the typescript code will not compile. |
I've recovered my problem by installing an older version of node tools. If
|
@mikelunn As Mohamed mentioned this is a very old issue, can you file a new issue with a sample project. And |
I had the same problem in my visual studio update 3. |
In typescript 2, you need to delete "outDir" in your tsconfig. Works for me. |
Since I installed TS 1.8 I've started noticing that the compile step is not being executed in Visual Studio either on save or upon build when there are existing
*.js
files in place.So if I'm working on
viewModel.ts
then I need to deleteviewModel.js
and trigger a Visual Studio build in order that a newviewModel.js
is created.My
tsconfig.json
looks like this:I wondered if it might be related to presence of the
compileOnSave
flag intsconfig.json
(which I believe is supported as of TS 1.8?). However setting it totrue
and removing it entirely made no discernible differerence to behaviour. (I tried closing and reopening the project in between changes in case there were caching issues but no change.)So
compileOnSave
seems entirely broken (i.e. it never compiles on save) and compile on build only works if the existing js files are deleted.The text was updated successfully, but these errors were encountered: