-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Typescript watch compiles each edited file twice #51611
Comments
please post log with |
terminal output with --extendedDiagnostics: sh-3.2$ tsc main.ts --watch --extendedDiagnostics Current directory: /Users/elads/Projects/testtsc CaseSensitiveFileNames: false Files: 6 CreatingProgramWith:: Files: 6 CreatingProgramWith:: Files: 6 thanks |
The same error in Typescript version 5.5.4 (macOS) |
Bug Report
π Search Terms
Typescript watch triggers multiple compilations
π Version & Regression Information
This changed when moving from Typescript version 4.8.4 to 4.9.3
Reviewed: #37994
β― Demonstration Video
Screen.Recording.2022-11-21.at.12.46.08.mov
π» Code
package.json
{
"name": "testtsc",
"version": "1.0.0",
"description": "Test double compilation of TypeScript files",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "Elad Stern",
"license": "ISC",
"dependencies": {
"typescript": "^4.9.3"
}
}
main.ts
let a: string = "123456790123";
alert(a.slice(0, 2));
π Actual behavior
In terminal, invoking npx and then tsc main.ts --watch, changing the source code of main.ts triggers Typescript watch to compile the file again - not once, but twice. The same took place in larger projects - double compilation of changed files, with one or two seconds in between.
π Expected behavior
Once a source code file has been changed, it should compile only once by tsc watch, not twice.
The text was updated successfully, but these errors were encountered: