Skip to content

Persistent incorrect semantic diagnostic after large rebase or checkout: File is not listed within the file list of project #47274

Closed
@MarcCelani-at

Description

@MarcCelani-at

Bug Report

When using tsserver in VSCode, I sometimes see persistent false error reports from diagnostics after a large rebase or checkout of the form, "File '{}' is not listed within the file list of project '{}'. Projects must list all files or use an 'include' pattern." The file mentioned in the error is a file that was newly created as part of the checkout or rebase. After waiting several minutes and noticing that the logs are idle, the only solution is to restart tsserver.

I have a repro case I would be willing to demonstrate live. In the repro, I have a file open (call it OpenFile.tsx) which imports a new file (call it NewFile.tsx). Here is a timeline of events in the logs related to a file that repros this issue:

  1. A DirectoryWatch event of type Wild card directory is triggered for NewFile
  2. A DirectoryWatch event of type Failed Lookup Locations is triggered for NewFile
  3. Lots of other watch processing is happening...
  4. A projectUpdatedInBackground event fires for the project that OpenFile and NewFile belong to
  5. A request comes into the language service for OpenFile's diagnostics
  6. An upgradeGraphWorker starts for the project that OpenFile and NewFile belong to
  7. A FileWatch is added for NewFile (Closed Script info type)
  8. The upgradeGraphWorker completes, and NewFile is listed in the long list of files and "Imported from" statements
  9. semanticDiag reports an error for OpenFile

In separate repros, I've noticed that...

(1) and (2) can swap places
(4) does not always happen. Maybe something else triggers the request?

🔎 Search Terms

IDE, VSCode, tsserver

🕗 Version & Regression Information

I don't have any information about when this started. It's been a problem that we have noticed for a long time. Our project is on 4.5.4

⏯ Playground Link

I can repro this but not on playground

💻 Code

I can repro this but not on playground

🙁 Actual behavior

A persistent incorrect semantic diagnostic saying that a file is missing after a large rebase or checkout

🙂 Expected behavior

After a reasonable amount of time, no semantic errors

Metadata

Metadata

Assignees

Labels

Fix AvailableA PR has been opened for this issueNeeds InvestigationThis issue needs a team member to investigate its status.RescheduledThis issue was previously scheduled to an earlier milestone

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions