Microsoft/TypeScript

tsc won't compile newly added references in watch mode

Open

#47.799 geöffnet am 8. Feb. 2022

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (6.726 Forks)batch import
BugDomain: tsc -bHelp Wanted

Repository-Metriken

Stars
 (48.455 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (9 gemergte PRs in 30 T)

Beschreibung

Bug Report

tsc won't compile newly added references in watch mode, while it compiles on initial start

I don't know if this description is clear :(
so i put an demonstration image in Steps to reproduce section

🔎 Search Terms

is:issue is:open references

🕗 Version & Regression Information

Typescript version : 4.5.5

⏯ Github repo

https://github.com/ryanroe/tsc-references-bug

💻 Steps to reproduce

  1. clone the repo
git clone https://github.com/ryanroe/tsc-references-bug
cd tsc-references-bug
npm install
npx tsc --build ./tsconfig.json -w
  1. open with Visual Studio Code (or any other editors) and remove the references field of root tsconfig.json
  2. save
  3. undo last operation (restore the references field)

tsc-references-bug

🙁 Actual behavior

tsc says the compilation is successful

Found 0 errors. Watching for file changes

🙂 Expected behavior

tsc should complain about the error of referenced project as initial start

error TS2304: Cannot find name 'a'.

BUT when i removed the files field of root tsconfig.json , everything works!

Contributor Guide