From c63b4a0f8106bc345745eeeedba7c248938e2046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kuty=C5=82a?= Date: Thu, 18 Jun 2026 12:17:04 +0200 Subject: [PATCH] fix(build): mark nodejs-whisper external in MCP bundling devglide setup runs scripts/build-mcp.mjs, which bundled the voice MCP with esbuild. nodejs-whisper (an optional whisper.cpp STT dependency) was not in the external allowlist, so esbuild tried to inline it. When the package is absent or fails to install, the build failed with 'Could not resolve nodejs-whisper' and aborted every remaining bundle, degrading all servers to the tsx fallback. The voice provider already imports nodejs-whisper lazily and degrades gracefully at runtime, so it should be external like better-sqlite3 and node-pty rather than bundled. --- scripts/build-mcp.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/build-mcp.mjs b/scripts/build-mcp.mjs index ee5cadb..a8c9989 100644 --- a/scripts/build-mcp.mjs +++ b/scripts/build-mcp.mjs @@ -20,7 +20,11 @@ const servers = [ "documentation", ]; -const external = ["better-sqlite3", "node-pty"]; +// Native / optional packages must not be inlined by esbuild. nodejs-whisper pulls in +// whisper.cpp and is an optional STT dependency that may be absent or fail to install; +// the voice provider imports it lazily and degrades gracefully at runtime. Bundling it +// makes the build fail with "Could not resolve 'nodejs-whisper'" when it is not present. +const external = ["better-sqlite3", "node-pty", "nodejs-whisper"]; // CJS packages bundled into ESM need a real require() for Node built-ins const banner = `import { createRequire as __bundleCR } from "module"; const require = __bundleCR(import.meta.url);`;