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

Incremental build: removing/adding new files need to restart tsc #49078

Closed
Jack-Works opened this issue May 12, 2022 · 6 comments · Fixed by #49246
Closed

Incremental build: removing/adding new files need to restart tsc #49078

Jack-Works opened this issue May 12, 2022 · 6 comments · Fixed by #49246
Labels
Bug A bug in TypeScript

Comments

@Jack-Works
Copy link
Contributor

Bug Report

Sorry I cannot give a small reproduction because I believe it is related to big projects.

When I'm working on big composited projects, when I added or remove a file, tsc will not be able to compile it correctly, and I need to restart tsc.

Add a new file

image

packages/mask/src/setup.ui.0.ts:4:19 - error TS6307: File 'packages/mask/src/new-file.ts' is not listed within the file list of project 'packages/mask/src/tsconfig.json'. Projects must list all files or use an 'include' pattern.

Config of this project:

  "compilerOptions": {
    "rootDir": "./",
    "lib": ["ES2021"]
  },
  "include": ["./", "./**/*.json"],

Removing a file

image

error TS6053: File 'packages/mask/src/utils/shadow-root/renderInShadowRoot.tsx' not found.
  The file is in the program because:
    Matched by include pattern './' in 'packages/mask/src/tsconfig.json'     

  packages/mask/src/tsconfig.json:10:15
    10   "include": ["./", "./**/*.json"],
                     ~~~~
    File is matched by include pattern specified here.

Once any of these error occurs, I have to restart TSC to get new type check results.

🔎 Search Terms

add remove restart tsc incremental

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

🙁 Actual behavior

🙂 Expected behavior

@craigphicks
Copy link

tsc -b -w , isn't it? Incremental and watch?

@Jack-Works
Copy link
Contributor Author

Yes we're using tsc -b -w since we have multiple projects

@andrewbranch
Copy link
Member

Duplicate of #47274. @Jack-Works are you able to share the repo where this is happening?

@andrewbranch andrewbranch added the Duplicate An existing issue was already created label May 24, 2022
@Jack-Works
Copy link
Contributor Author

Duplicate of #47274. @Jack-Works are you able to share the repo where this is happening?

Yes, it is http://github.com/DimensionDev/Maskbook

@sheetalkamat
Copy link
Member

Thank for the repro. Investigating

sheetalkamat added a commit that referenced this issue May 25, 2022
sheetalkamat added a commit that referenced this issue May 25, 2022
…st directory separator for wildcard directory (#49246)

* Add failing test

* Fix the implicit glob key so that recursive keys are not differing just by directory seperator
Fixes #49078

* Reset the reload level once program is loaded
typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this issue May 25, 2022
Component commits:
b846905 Add failing test

66d51e5 Fix the implicit glob key so that recursive keys are not differing just by directory seperator Fixes microsoft#49078

f93951f Reset the reload level once program is loaded
@Jack-Works
Copy link
Contributor Author

cool! thanks! this is a quick fix

@DanielRosenwasser DanielRosenwasser added this to the TypeScript 4.7.3 milestone Jun 1, 2022
@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript and removed Duplicate An existing issue was already created labels Jun 1, 2022
DanielRosenwasser pushed a commit that referenced this issue Jun 1, 2022
Component commits:
b846905 Add failing test

66d51e5 Fix the implicit glob key so that recursive keys are not differing just by directory seperator Fixes #49078

f93951f Reset the reload level once program is loaded

Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
5 participants