c70eb1f945e0e603afbfe37d1cf2cb84f3d70a27
Replacing the Next standalone node_modules broke turbopack's externalized- module resolution: the standalone tree is a matched set with the turbopack server chunks, resolving externals (better-auth, postgres, pino, minio, ...) by hashed id. With it replaced, every route using them 500'd with "Failed to load external module <pkg>-<hash>" — confirmed on prod, while `node .next/standalone/server.js` with the intact tree serves GET / (307) and /api/health (200) cleanly. So keep the standalone tree intact and MERGE the complete hoisted prod tree in with `rsync --ignore-existing`: it adds the custom server's missing CJS requires (socket.io closure: accepts/ws/engine.io/cors; drizzle-orm/index.cjs) and skips everything the trace already provides — and tolerates the trace's pnpm symlinks, where COPY/cp/tar/fs.cpSync all error on symlink-vs-dir. Validated end-to-end on a host assembly of (intact standalone + merged prod deps + the polyfilled server bundle): GET / → 307, /api/health → 200, zero "Failed to load external module", zero MODULE_NOT_FOUND, server listening. rsync --ignore-existing merge semantics verified in node:20-alpine. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Description
No description provided
Languages
TypeScript
98.7%
HTML
1%
CSS
0.1%
Shell
0.1%