Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(build): bundle sqlite-vec native binary into standalone (vector memory in Docker)

diegosouzapwe176d0abd4cc
diff --git a/scripts/build/build-next-isolated.mjs b/scripts/build/build-next-isolated.mjs
index aa4f0037a7..b587abba27 100644
--- a/scripts/build/build-next-isolated.mjs
+++ b/scripts/build/build-next-isolated.mjs
@@ -269,6 +269,28 @@ export async function syncStandaloneExtraModules(
sourcePath: path.join(rootDir, "node_modules", "playwright-core"),
destRelative: path.join("node_modules", "playwright-core"),
},
+ {
+ label: "sqlite-vec wrapper (vector memory — loaded at runtime via createRequire)",
+ sourcePath: path.join(rootDir, "node_modules", "sqlite-vec"),
+ destRelative: path.join("node_modules", "sqlite-vec"),
+ },
+ // sqlite-vec's native vec0.so lives in a platform-specific package resolved at
+ // runtime via require.resolve(). Next.js does NOT trace it into the standalone
+ // (the externalized wrapper is copied, but its optional platform dep is missed —
+ // Next.js #88844), so without this the bundled/Docker build silently degrades
+ // vector search to FTS5: the wrapper loads but getLoadablePath() throws
+ // MODULE_NOT_FOUND. Copy whichever platform package npm actually installed. See #3066.
+ ...[
+ "sqlite-vec-linux-x64",
+ "sqlite-vec-linux-arm64",
+ "sqlite-vec-darwin-x64",
+ "sqlite-vec-darwin-arm64",
+ "sqlite-vec-windows-x64",
+ ].map((pkg) => ({
+ label: pkg,
+ sourcePath: path.join(rootDir, "node_modules", pkg),
+ destRelative: path.join("node_modules", pkg),
+ })),
];
let changed = false;