Skip to content

Commit f51e7cb

Browse files
A.R.devin-ai-integration[bot]
andcommitted
build(mcp-server): avoid tsup DTS worker OOM by delegating to tsc --allowJs --emitDeclarationOnly
The 47-entry-point mcp-server bundle causes tsup's rollup-dts worker to hit ERR_WORKER_OUT_OF_MEMORY on Node 22 / Windows (pre-existing; reproducible on commits before 0.8.43). Split the build so tsup handles the ESM bundle and a post-step `tsc --allowJs --emitDeclarationOnly` generates the .d.ts files. This unblocks the full extension build pipeline. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent c1f6dab commit f51e7cb

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/mcp-server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"CHANGELOG.md"
127127
],
128128
"scripts": {
129-
"build": "tsup && node scripts/post-build-shebang.mjs",
129+
"build": "tsup --no-dts && tsc --allowJs --emitDeclarationOnly && node scripts/post-build-shebang.mjs",
130130
"typecheck": "tsc -p tsconfig.json --noEmit",
131131
"test": "cd ../.. && npx vitest run packages/mcp-server/test",
132132
"test:coverage": "cd ../.. && npx vitest run --coverage packages/mcp-server/test"

packages/mcp-server/tsup.config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ export default defineConfig({
5151
target: "node20",
5252
outDir: "dist",
5353
clean: true,
54-
dts: true,
54+
// tsup's rollup-dts worker thread OOMs on this package's 47 entry points
55+
// under Node 22 / Windows (pre-existing; fails even on commits before 0.8.43).
56+
// Declarations are generated separately with tsc --allowJs --emitDeclarationOnly
57+
// in the package.json build script, which is faster and avoids the worker heap.
58+
dts: false,
5559
// got-scraping and its transitive data-bearing deps must resolve at runtime
5660
// from node_modules (they load JSON data files via fs.readFileSync that tsup
5761
// can't inline). Same story for patchright (native Chromium).

0 commit comments

Comments
 (0)