microsoft / microsoft/TypeScript

npx tsc -w is triggering itself after each build

Open
#64,037 5 comments 0 reactions 0 assignees View on GitHub
Needs More Info
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

### 🔎 Search Terms

No amount of exclude or watchOptions seems to have any impact.

I am outputting my JavaScript files along side my TS files, which is what I want, I don't know why it keeps retriggering itself

Output looks like this

```
> npx tsc --watch --extendedDiagnostics
[08:05:29 PM] Starting compilation in watch mode...

[08:05:29 PM] Found 0 errors. Watching for file changes.

[08:05:29 PM] File change detected. Starting incremental compilation...

[08:05:30 PM] Found 0 errors. Watching for file changes.

[08:05:30 PM] File change detected. Starting incremental compilation...

[08:05:31 PM] Found 0 errors. Watching for file changes.

[08:05:31 PM] File change detected. Starting incremental compilation...

[08:05:31 PM] Found 0 errors. Watching for file changes.

[08:05:32 PM] File change detected. Starting incremental compilation...

[08:05:32 PM] Found 0 errors. Watching for file changes.
```

npx tsc --showConfig doesn't show any watchOptions not sure if they are getting picked up

### 🕗 Version & Regression Information

"name": "@typescript/typescript-win32-x64",
"version": "7.0.2",

### ⏯ Playground Link

_No response_

### 💻 Code

_No response_

### 🙁 Actual behavior

tsc -w triggers itself in a loop

### 🙂 Expected behavior

tsc -w doesn't triggers itself in a loop

### Additional information about the issue

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the loop with the reported npx tsc --watch --extendedDiagnostics command and the project configuration that emits JavaScript beside TypeScript files. Inspect how watchOptions and emitted files interact with watch mode; done means compilation completes without detecting its own output as repeated file changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.