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

Compile on save stop working after typescript v2.1.5 in Visual Studio 2015 #15083

Closed
IvanYur4enk0 opened this issue Apr 8, 2017 · 11 comments
Closed
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@IvanYur4enk0
Copy link

IvanYur4enk0 commented Apr 8, 2017

TypeScript Version: 2.2.2 for Visual Studio 2015, downloaded from http://download.microsoft.com/download/6/D/8/6D8381B0-03C1-4BD2-AE65-30FF0A4C62DA/TS-2.2-dev14update3-20170321.1/TypeScript_Dev14Full.exe

tsconfig.json

{
	"compileOnSave": true,
	"compilerOptions": {
		"baseUrl":  "Scripts/app",
		"noImplicitAny": false,
		"noEmitOnError": true,
		"removeComments": true,
		"sourceMap": true,
		"module": "commonjs",
		"target": "es5"
	},
	"exclude": [
		"node_modules"
	]
}

Expected behavior:

js file should be generated\updated on each ts file change.

Actual behavior:

  • js files generating\updating only on web project build\rebuild.
  • If remove typescript 2.2.2 and install typescript 2.1.5 - all working fine and js files generating\updating on each ts file change.

On our project this behaviour actual for all developers(they have different windows os and other visual studio settings, Update 3 installed on all machines) who update typescript to 2.2.2 version.

@IvanYur4enk0 IvanYur4enk0 changed the title Compile on save stop working in typescript 2.2.2 in Visual Studio 2015 Compile on save stop working in typescript v2.2.2 in Visual Studio 2015 Apr 8, 2017
@IvanYur4enk0 IvanYur4enk0 changed the title Compile on save stop working in typescript v2.2.2 in Visual Studio 2015 Compile on save stop working in typescript v2.2.2 in Visual Studio 2015 Update 3 Apr 8, 2017
@IvanYur4enk0 IvanYur4enk0 changed the title Compile on save stop working in typescript v2.2.2 in Visual Studio 2015 Update 3 Compile on save stop working in typescript v2.2.2 in Visual Studio 2015 Apr 8, 2017
@grichards23
Copy link

I am also seeing this.
After TypeScript Tools for Visual Studio 2015 2.1.5, "compileOnSave" no longer works for any developer on my team.

I tried 2.2.0, 2.2.1, 2.2.2 and 2.3.0
Is there another work around besides downgrading?
Having to build\rebuild to get the js files in sync is cumbersome at best.

@IgorVyatkin
Copy link

Still doesn't work with TypeScript Tools for Visual Studio 2015 2.3.1.

@mhegazy mhegazy added the Bug A bug in TypeScript label May 3, 2017
@mhegazy mhegazy added this to the TypeScript 2.4 milestone May 3, 2017
@jramsay
Copy link
Member

jramsay commented May 8, 2017

@IvanYur4enk0 : Thanks for flagging this. I'm trying to repro using VS2015 Update 3 with the TS 2.2.2 install that you linked to above. I've put your tsconfig.json at the project root level and a scripts\App folder that contains two .ts files. Compile On Save is working correctly for me so there must be something different about our project setup. The only time it doesn't Compile On Save is when there are TS errors in the Error List (this is by design). I'll attach a screenshot of my test. Can you take a look and see if the set up looks different than yours (ex: location of .ts files or tsconfig.json). Also can you confirm that there are no errors in the error list when you save and that other language service features are working correctly (ex: completions & navigation bar). I'd also be curious to know if you're seeing 3 dropdowns in the nav bar or only 2?

(BTW: the generated js files are hidden by default in the solution explorer. Sometimes I have to toggle the Show All Files button for them to show up
compileonsave

@IvanYur4enk0
Copy link
Author

@jramsay thank you for answer,

Also can you confirm that there are no errors in the error list when you save and that other language service features are working correctly (ex: completions & navigation bar)

Yes, I can confirm that no errors in solution and js files are generating correctly with the same source code using build\rebuild, only compile on save is not working.

Completions and navigation bar are also working correctly.

I'd also be curious to know if you're seeing 3 dropdowns in the nav bar or only 2

I can see 3 dropdowns.

@IvanYur4enk0
Copy link
Author

IvanYur4enk0 commented May 9, 2017

Maybe this problem is related with this issue.

I can see the same errors in Errors -> Intellisense while typing code in VS. And the problem appeared after typescript 2.1.5.

Severity	Code	Description	Project	File	Line	Suppression State

Error	TS5055	Cannot write file '{Project Path}/node_modules/jquery/dist/jquery.js' because it would overwrite input file.	TypeScript Virtual Projects		1	Active

Error	TS5055	Cannot write file '{Project Path}/node_modules/lodash/lodash.js' because it would overwrite input file.	TypeScript Virtual Projects		1	Active

{and the same errors with other imported libraries}

@IvanYur4enk0 IvanYur4enk0 changed the title Compile on save stop working in typescript v2.2.2 in Visual Studio 2015 Compile on save stop working after typescript v2.1.5 in Visual Studio 2015 May 9, 2017
@IvanYur4enk0
Copy link
Author

IvanYur4enk0 commented May 9, 2017

@jramsay, sample uploaded: 15083_Sample.zip.

Steps to reproduce:

  1. Install npm dependencies.
  2. Open TestTypeScriptCompileOnSave.sln solution.
  3. Rebuild solution -> sources compiling without errors, js file generated with valid content.
  4. Try to modify "Scripts\app\test1.ts", for example change alert('8') to alert('9') -> compile on save is not working. No build errors, 1 intellisense error:
Error	TS5055	Cannot write file '{Project Path}/node_modules/lodash/lodash.js' because it would overwrite input file.	TypeScript Virtual Projects		1	Active
  1. Try to Build\Rebuild web project -> sources compiling without errors, js file generated with valid content.

@jramsay
Copy link
Member

jramsay commented May 9, 2017

@IvanYur4enk0: so nice to get a repro project - thanks! I'm seeing the same behavior now. Will take a look and see what is happening.

@noxborough
Copy link

I tested with Visual Studio 2015 and "2.3.3-insiders.20170512" build or typescript, and it fixed my problem. Will there be a official release of 2.3.3, or do i wait for 2.4?

Of course since the latest release of Typescript for Visual Studio 2015 is stuck at version 2.3.1, i had to hot swap in the typescriptServices.js from the insiders build to get Visual Studio to behave.

@mhegazy
Copy link
Contributor

mhegazy commented May 22, 2017

TS 2.3.3 should be available today.

@simeyla
Copy link

simeyla commented May 31, 2017

I'm using the 'Typescript Build' option for a 'traditional' ASP.NET project and something strange is going on with 2017 and it isn't just the typescript version installed.

If on Ctrl+S you don't get the generated file I've noticed that restarting VS2017 can fix this issue. I was working all weekend on something and never noticed an issue and then suddenly it started playing up - no errors but no 'Output(s) generated successfully.' message either. Restart of the IDE fixed it.

@JosueMartinez
Copy link

@simeyla solution worked for me. thanks

@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

8 participants