Skip to content

Commit 96f4c1b

Browse files
authored
chore(core,sdk): make the ai-v7 typecheck pass deterministic (#3847)
## Summary The SDK and core packages run a second, forward-compat typecheck pass (`tsc --noEmit -p tsconfig.ai-v7.json`) that remaps the `"ai"` import to the ESM-only AI SDK 7 canary, so we catch source that only compiles against one major. That pass inherited `composite: true` from the base tsconfig, which makes `tsc` write a `.tsbuildinfo` even under `--noEmit`. Incremental buildinfo caches each file's resolved module format (CJS vs ESM) and module resolution. When that state goes stale or is replayed, the v7 pass can report spurious `TS1479` ("CommonJS module ... cannot `require` an ECMAScript module") errors on the `"ai"` import even though the source is fine in a clean checkout. Because this pass shares the typecheck job that gates the Docker image publish, a spurious failure there blocks publishing. ## Fix Set `composite: false` and `incremental: false` on both `tsconfig.ai-v7.json` files. The pass is `--noEmit` only, so it never needed incremental state. Now each run is a clean, full check that writes no buildinfo and can't replay stale resolution. Verified: both `@trigger.dev/sdk` and `@trigger.dev/core` typecheck green, and neither writes an ai-v7 `.tsbuildinfo` anymore.
1 parent 4711ade commit 96f4c1b

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

packages/core/tsconfig.ai-v7.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
// file-direct rationale.
77
"extends": "./tsconfig.src.json",
88
"compilerOptions": {
9+
// noEmit-only gate: disable composite/incremental so this pass never writes or
10+
// reads a .tsbuildinfo and can't replay stale module resolution across runs.
11+
"composite": false,
12+
"incremental": false,
913
"baseUrl": ".",
1014
"paths": {
1115
"ai": ["./node_modules/ai-v7/dist/index.d.ts"]

packages/trigger-sdk/tsconfig.ai-v7.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
// real installed `ai`, which would make this pass a no-op.
1010
"extends": "./tsconfig.json",
1111
"compilerOptions": {
12+
// noEmit-only gate: disable composite/incremental so this pass never writes or
13+
// reads a .tsbuildinfo and can't replay stale module resolution across runs.
14+
"composite": false,
15+
"incremental": false,
1216
"baseUrl": ".",
1317
"paths": {
1418
"ai": ["./node_modules/ai-v7/dist/index.d.ts"]

0 commit comments

Comments
 (0)