fix(docker): complete prod node_modules for the custom server
Follow-up to the NODE_PATH attempt, which fixed 'accepts' but not the general case: server-custom.js is CJS (esbuild --packages=external) and require()s deps the Next standalone trace ships ESM-only or omits, e.g. drizzle-orm/index.cjs (present-but-incomplete in the traced tree, so a NODE_PATH fallback can't rescue it). Replace the traced node_modules with the complete hoisted prod tree so every external resolves. That tree is prod-only, so move @next/bundle-analyzer (required at runtime by next.config — its import is unconditional even though enabled is gated on ANALYZE) from devDependencies to dependencies; otherwise the standalone config load throws MODULE_NOT_FOUND in prod. Validated end-to-end on a host prod install + standalone assembly: socket server boots, Socket.io initializes, HTTP listens, /api/health → 200, no MODULE_NOT_FOUND, no AsyncLocalStorage invariant. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
"@dnd-kit/utilities": "^3.2.2",
|
||||
"@formkit/auto-animate": "^0.9.0",
|
||||
"@hookform/resolvers": "^5.2.2",
|
||||
"@next/bundle-analyzer": "^16.2.6",
|
||||
"@radix-ui/react-accordion": "^1.2.12",
|
||||
"@radix-ui/react-alert-dialog": "^1.1.15",
|
||||
"@radix-ui/react-avatar": "^1.1.11",
|
||||
@@ -140,7 +141,6 @@
|
||||
"@axe-core/playwright": "^4.11.3",
|
||||
"@faker-js/faker": "^10.4.0",
|
||||
"@hookform/devtools": "^4.4.0",
|
||||
"@next/bundle-analyzer": "^16.2.6",
|
||||
"@playwright/test": "^1.60.0",
|
||||
"@tailwindcss/postcss": "^4.3.0",
|
||||
"@total-typescript/ts-reset": "^0.6.1",
|
||||
|
||||
Reference in New Issue
Block a user