Skip to content

app-shell tsc build fails under full turbo build (missing plugin-* .d.ts), masked by turbo cache #1760

Description

@os-zhuang

Problem

@object-ui/app-shell builds with tsc (composite). Under a full turbo build (pnpm turbo run build --filter='./packages/*', as the performance-budget.yml "Bundle Analysis" job runs), app-shell's tsc fails with ~25 error TS2307: Cannot find module '@object-ui/plugin-*' across many files (DashboardView, ReportView, RecordDetailView, ObjectView, previews, …) plus cascading IntrinsicAttributes / implicit-any errors that are all downstream of the unresolved plugin modules.

This is long-masked by turbo cache: any PR that does not change an app-shell dependency gets a cache hit for app-shell#build and the job is green (e.g. #1743). The first PR that touches an app-shell dependency (e.g. #1757 changed @object-ui/types + plugin-charts/list/view) invalidates the cache, app-shell actually re-builds, and the latent failure surfaces.

Evidence

  • pnpm --filter @object-ui/app-shell buildin isolation (deps' dist already present) → exit 0, 0 errors.
  • pnpm turbo run build --filter='./packages/*' from clean → app-shell fails (37 successful, 1 failed). Same in CI Bundle Analysis (re-run reproduced).
  • All errors are module-resolution for plugin-* packages app-shell does declare as deps; none are in PR-specific code.

Likely root cause

plugin-* packages build via vite build; app-shell's tsc needs their .d.ts. Under turbo's parallel build the .d.ts for some plugin-* packages isn't reliably present/ready when app-shell's tsc runs (vite dts emit timing / declaration outputs not declared as turbo outputs for cache-correct ordering). app-shell's tsconfig references only 6 composite packages; the plugin-* deps resolve via node module resolution against dist.

Suggested directions (pick one)

  1. Ensure every plugin-* vite build emits .d.ts and declares it in turbo outputs so ordering/caching is correct.
  2. Switch app-shell's build off composite tsc to the same vite build the plugin packages use.
  3. Add the plugin-* packages to app-shell tsconfig.references (requires they be composite).

Impact

Blocks the "all-green" bar for any PR that changes an app-shell dependency, even when the PR's own code is correct (e.g. #1757, verified via Build & E2E + in-browser). Surfaced by objectstack-ai/objectstack#1890 / #1757.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions