Skip to content

fix(build): exclude node_modules from turbo tsbuildinfo outputs - #2202

Merged
os-zhuang merged 1 commit into
mainfrom
worktree-turbo-tsbuildinfo-fix
Jul 4, 2026
Merged

fix(build): exclude node_modules from turbo tsbuildinfo outputs#2202
os-zhuang merged 1 commit into
mainfrom
worktree-turbo-tsbuildinfo-fix

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Problem

pnpm build fails at @object-ui/runner:

Rolldown failed to resolve import "@object-ui/i18n" from ".../packages/react/src/index.ts".

The pnpm workspace symlinks under packages/*/node_modules/@object-ui/* had degraded from proper symlinks into empty real directories containing only tsconfig.tsbuildinfo (each with an .ignored_* twin). With no package.json/dist, rolldown can't resolve @object-ui/i18n (and @object-ui/data-objectstack, etc.), and the runner's Vite build — which aliases @object-ui/react to source — dies on the first unresolved re-export.

Root cause

The build outputs glob **/*.tsbuildinfo, added in #1767 to cache composite tsc build info, also matches tsconfig.tsbuildinfo files reachable through the pnpm workspace symlinks — e.g. packages/react/node_modules/@object-ui/core/node_modules/@object-ui/types/tsconfig.tsbuildinfo. Turbo caches those paths and, on cache restore, recreates them as real directories, clobbering the symlinks. The corruption compounds build-over-build (cache artifacts even captured .ignored_core from a prior round).

Verified directly from the local turbo cache artifacts — they were packed full of deeply-nested node_modules/@object-ui/**/tsconfig.tsbuildinfo entries.

Fix

Add !**/node_modules/** to the build outputs so turbo never captures or restores anything under node_modules, while still caching the package-root tsconfig.tsbuildinfo that #1767 relies on.

Validation

Cold build in a fresh worktree (healthy symlinks) with the fix:

  • 44/44 build tasks succeeded
  • All @object-ui/* workspace symlinks intact after the build (no clobbering)
  • 0.ignored_* directories created
  • 0node_modules/**tsbuildinfo entries across all 44 new cache artifacts (only package-root tsconfig.tsbuildinfo is captured, e.g. packages/auth/tsconfig.tsbuildinfo)

🤖 Generated with Claude Code

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>
@vercel

vercelBot commented Jul 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectuiIgnoredIgnoredJul 4, 2026 1:08am

Request Review

@os-zhuang
os-zhuang merged commit 638bbd9 into mainJul 4, 2026
8 of 9 checks passed
@os-zhuang
os-zhuang deleted the worktree-turbo-tsbuildinfo-fix branch July 4, 2026 01:26
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@os-zhuang