You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build: bun run build fails on @cap/sdk-recorder DTS — package is outside the typecheck graph #2915
@cap/sdk-recorder:build: src/index.ts(88,38): error TS2345: Argument of type 'EventHandler<K>' is not assignable to parameter of type 'EventHandler<keyof RecorderEventMap>'.
@cap/sdk-recorder:build: Type 'keyof RecorderEventMap' is not assignable to type 'K'.
@cap/sdk-recorder:build: 'keyof RecorderEventMap' is assignable to the constraint of type 'K', but 'K' could be instantiated with a different subtype of constraint 'keyof RecorderEventMap'.
@cap/sdk-recorder:build: Error: error occurred in dts build
@cap/sdk-recorder:build: error: script "build" exited with code 1
Reproduces standalone with bun run --cwd packages/sdk-recorder build (exit 1). It is pre-existing: it reproduces with the Bun 1.4.4 branch changes stashed at c3f0a92.
on<K extends keyof RecorderEventMap>(event: K, handler: EventHandler<K>) erases the key type with an explicit cast on add (line 86) but not on delete (line 88):
packages/sdk-recorder is not in the root tsconfig.jsonreferences (ui, recorder-core, ui-solid, utils, desktop, chrome-extension, web), so bun run typecheck never checks this package.
No workflow runs bun run build (grep "bun run build" .github/workflows/*.yml returns nothing).
Both the TypeScript 5.9.3 checker used by tsup's DTS build and Bun's TypeScript 7.1-dev checker (bun check -p packages/sdk-recorder) report the same error, so this is not a checker-version artifact.
Beyond the one-line fix, add the package to the root tsconfig.jsonreferences so bun run typecheck covers it. A CI job that runs bun run build (or at least turbo run build --filter=@cap/sdk-recorder) would keep this from regressing.
Note: the SIGSEGV/SIGBUS seen when running the full build is unrelated and environmental — it reproduces under Node 26 as well, and the build is stable at --concurrency=2.
Activity
linear commentedon Oct 22, 2026
CAP-870