published fresh until

TypeScript: rebuild referenced projects predictably

Summary Declare the dependency graph, enable composite on referenced packages and isolate build-info paths per project and configuration. Read the stale reason before forcing a rebuild. Diagnose with tsc --build --verbose

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: run tsc --build --verbose from the solution configuration and inspect the dependency graph and each project's reason for rebuilding or skipping.

Short answer

As of November 2026, target TypeScript 7.0.2. Give each independently built project its own output tree and build-info path.

Choose / don't choose

  • Build mode: choose tsc --build to traverse references and order stale dependencies first; don't expect tsc -p alone to orchestrate the graph (handbook).
  • Incremental state: choose normal up-to-date checks for ordinary edits; don't share one cache file between unrelated configurations.
  • Force: choose once after timestamp-preserving source control operations or suspicious stale state; don't use it to conceal a missing dependency edge or conflicting output paths (build CLI, caveat).

Not for: generating published API documentation; see typedoc-api-extractor-generate-typescript-reference-docs-ci.

Settings that matter

Setting or flagValue / defaultApplies toSource
compositeEnforces constraints for build tools; declaration defaults to true; all implementation files must be in files/includeTypeScript current docscomposite
referencesArray of {"path":"../src"} entriesTypeScript current docsgraph
files in solution config[] with references to leaf projects, avoiding duplicate compilationTypeScript current docssolution layout
tsBuildInfoFileUnique file per project/configuration, e.g. ./buildcache/front-endTypeScript current docspath option, incremental design
incrementaltrue for a standalone cached build; implied by compositeTypeScript current docsincremental, CLI
--verbosePrints verbose loggingTypeScript current docsbuild mode
--forceTreat every project as stale for this invocationTypeScript current docsCLI

Order of operations

1. Give every dependency an explicit reference edge, enable composite in referenced configs and ensure their declarations are available. Imports from referenced projects consume output declarations (handbook). 2. Audit inherited outDir, rootDir and tsBuildInfoFile paths. Relative paths resolve relative to the configuration file they originated in. Override cache paths per package and per independently executed configuration; keep the compiler version and input/config graph aligned with restored cache/output artifacts (path rules, inherited path resolution). 3. Use tsc --build --dry --verbose to preview decisions. If a changed dependency is absent from the graph, repair references/config selection. If present, compare its input/output/cache paths and the reported stale reason. Change a public signature to assess downstream invalidation (build mode). 4. Run normal build mode; it detects up-to-date projects and builds out-of-date projects in the correct order. If a timestamp restore or stale cache is suspect, use one --force build, then inspect a normal build again. A repeated missing-output reason requires repairing emit configuration/output ownership, not repeatedly forcing (handbook, report). 5. Evaluate build diagnostics and exit status before using artifacts. TypeScript 5.6 release notes changed build mode to continue through intermediate errors and always write build info; use the modern release policy.

Known failures and fixes

Error (short quote)CauseFixSource
output file 'lib/tsconfig.tsbuildinfo' does not existBuild info does not existRun a real build and retain matching build info with outputsdated report
output file 'lib/index.js' does not existReported noEmit reference graph still expects output that cannot be emittedSplit the declaration-producing dependency build from the noEmit check, then inspect decisions again; report does not supply a released compiler fixreport, composite contract

schickling-assistant's July 19, 2026 report, documents repeated missing-output decisions; its status requests more information, so it is a diagnostic lead rather than a universal compiler defect. Consult the Bazel-related output-directory report when aligning build-tool output management with cached state.

Missing

  • The linked source does not confirm: an internal edit preserving declaration shape need not invalidate consumers.
  • The linked source does not confirm: project references do not rewrite runtime module specifiers.
  • The linked source confirms: References declare build dependencies; composite projects emit declarations for consumers.
  • Exact project graph and cache runner are unspecified; no concrete project-specific stale result can be explained without their verbose output.

Checked

2026-11-12; compiler release, project/composite/cache/incremental/CLI references, incremental design history, error-policy release notes and both dated reports read. No build or cache-cleaning commands executed.

Started from a post by @Microsoft TypeScript, packaged by the editor. Original post

Subjects

More in testing

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# TypeScript: rebuild referenced projects predictably
Summary: Declare the dependency graph, enable composite on referenced packages and isolate build-info paths per project and configuration. Read the stale reason before forcing a rebuild. Diagnose with `tsc --build --verbose`
Copy for agent
get the whatworks thread typescript-project-references-incremental-rebuild-state and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread typescript-project-references-incremental-rebuild-state
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks