Skip to content
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

Visual Studio 2017 is compiling JS file without associated TS file #14827

Closed
styfle opened this issue Mar 23, 2017 · 7 comments
Closed

Visual Studio 2017 is compiling JS file without associated TS file #14827

styfle opened this issue Mar 23, 2017 · 7 comments
Labels
Bug A bug in TypeScript

Comments

@styfle
Copy link
Contributor

styfle commented Mar 23, 2017

TypeScript Version: 2.1.5

Code
Get master branch from here:
https://github.com/styfle/TypeScriptReproBug

Expected behavior:
Do not compile .js files if there is no matching .ts file.

Actual behavior:
The .js files are modified and a .js.map file is generated.

More Info

I opened an existing 2015 project in VS 2017, edited a .d.ts file, saved, and VS started compiling a lot of files....files that do not have a .ts associated with them 😨

image

Then I looked at git changes in Team Explorer tab and I can see that a bunch of .js files were modified and a bunch of .js.map files were added.

image

@billti Please review the code. Thanks!

@mhegazy mhegazy added the Bug A bug in TypeScript label Mar 23, 2017
@billti
Copy link
Member

billti commented Mar 23, 2017

Thanks. I just tried this and couldn't repro, then realized I was running TypeScript 2.2. Switching to 2.1 (that comes with VS 2017) I could repro.

If you could try using TypeScript 2.2 (as outlined in #14529 (comment) ) and confirm this fixes the issue, at least we'll know this is already addressed somehow (I couldn't spot the exact commit which would have fixed it).

@styfle
Copy link
Contributor Author

styfle commented Apr 21, 2017

I haven't got around to testing this but is there a new version of TypeScript going to be released with a 2017 update?

@styfle
Copy link
Contributor Author

styfle commented May 10, 2017

I just realized <TypeScriptToolsVersion/> is set to 1.8.

I went ahead and tried to reproduce with the latest Visual Studio released May 10, 2017 - version 15.2 (26430.04).

Without any changes to <TypeScriptToolsVersion/> the bug is still present, however changing <TypeScriptToolsVersion/> to 2.2 fixes the bug.

@billti
Copy link
Member

billti commented May 11, 2017

Thanks for confirming it's fixed in the latest release.

@billti billti closed this as completed May 11, 2017
@styfle
Copy link
Contributor Author

styfle commented May 16, 2017

@billti I just had this happen to me again today. I am using Version 15.2 (26430.6) now.

@styfle
Copy link
Contributor Author

styfle commented May 16, 2017

Is this supposed to be fixed with selecting TypeScript 2.1 or only in 2.2?

@crh225
Copy link

crh225 commented May 25, 2017

Im on 2.3.3 and it is happening to me also

@microsoft microsoft locked and limited conversation to collaborators Jun 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

5 participants