Fix Passenger ESM incompatibility — add server.cjs CJS wrapper
Passenger's node-loader uses require() which cannot load ES modules. server.cjs is a CommonJS shim that bridges into server.js via dynamic import(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
e91ff1ce89
commit
8656e6e470
+1
-1
@@ -16,7 +16,7 @@
|
||||
"dev:api": "npm run dev -w apps/api",
|
||||
"build": "npm run build -w apps/web",
|
||||
"build:check": "npm run build && npm run typecheck",
|
||||
"start": "node server.js",
|
||||
"start": "node server.cjs",
|
||||
"db:generate": "npm run generate -w packages/db",
|
||||
"db:migrate": "npm run migrate -w packages/db",
|
||||
"typecheck": "npm run typecheck --workspaces --if-present"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// CommonJS wrapper for Phusion Passenger.
|
||||
// Passenger's node-loader uses require(), which cannot load ES modules directly.
|
||||
// This shim bridges into the ESM entry point via dynamic import().
|
||||
import('./server.js').catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user