Uh oh!
There was an error while loading. Please reload this page.
fix(build): cache composite tsc .tsbuildinfo as a turbo output - #1767
Merged
Conversation
Composite-tsc packages (composite: true) write incremental state to <package>/tsconfig.tsbuildinfo at the package root. turbo's `build` task only declared dist/**/.next/**/build/** as outputs, so the incremental build-info was neither hashed nor cached/restored in sync with dist. A turbo cache hit then restored dist but left whatever stale tsbuildinfo happened to be on disk, and a build run with a desynced tsbuildinfo could under-emit (e.g. tsc believing the project is up-to-date), producing a partial dist that turbo would then cache and replay — surfacing as `TS2307: Cannot find module '@object-ui/app-shell'` in consumers. Add **/*.tsbuildinfo to the `build` task outputs so incremental state is cached and restored atomically with dist. CI fresh checkouts were already safe (*.tsbuildinfo is gitignored → always a full emit); this closes the local / warm-cache desync. Follow-up to #1760 / #1766. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Uh oh!
There was an error while loading. Please reload this page.
os-zhuang added a commit
that referenced
this pull request
Jul 4, 2026
The build `outputs` glob `**/*.tsbuildinfo` (added in #1767 to cache composite tsc .tsbuildinfo) also matched tsbuildinfo files reachable through pnpm's workspace symlinks under `node_modules/@object-ui/*`. Turbo cached those paths and, on cache restore, recreated them as real directories — clobbering the pnpm symlinks. The workspace links degraded into empty dirs holding only `tsconfig.tsbuildinfo` (plus `.ignored_*` twins), so rolldown could no longer resolve `@object-ui/i18n` et al. and `pnpm build` failed in @object-ui/runner. Add `!**/node_modules/**` to the outputs so turbo never captures or restores anything under node_modules, while still caching the package-root `tsconfig.tsbuildinfo` that #1767 relies on. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Follow-up to #1760 / #1766. Composite-
tscpackages (composite: true— e.g.packages/app-shell,react,core,types,tenant,mobile) write incremental build state to<package>/tsconfig.tsbuildinfoat the package root. Thebuildtask inturbo.jsononly declareddist/**,.next/**,build/**asoutputs, so the incremental build-info was:dist/.A turbo cache hit restored
dist/but left whatever staletsconfig.tsbuildinfohappened to be on disk; a build run against a desynced tsbuildinfo can under-emit (tsc believing the project is up-to-date), producing a partialdist/that turbo then caches and replays — surfacing asTS2307: Cannot find module '@object-ui/app-shell'in consumers. (Observed while diagnosing #1760, when manually clearingdist/but not the package-root tsbuildinfo.)Fix
Add
**/*.tsbuildinfoto thebuildtaskoutputsso the incremental state is cached and restored atomically withdist/.Scope / safety
*.tsbuildinfois gitignored, so it's always absent on checkout → tsc always does a full emit. This change closes the local / warm-cache desync where a cache hit could pair a restoreddist/with a stale tsbuildinfo.Verification
This is a one-line
turbo.jsonoutputsaddition (valid JSON, valid output glob). The authoritative check is CI's Bundle Analysis job (pnpm turbo run build --filter='./packages/*'), which runs the realturbo run buildand must stay green. (Local turbo was unavailable in my worktree due to an unrelated install/platform-binary flake; CI is the source of truth for turbo behavior here.)🤖 Generated with Claude Code