Skip to content

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

Closed
@Jack-Works

Description

@Jack-Works

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions