-
-
Notifications
You must be signed in to change notification settings - Fork 68.9k
PM2/Production Deployment Failure #38
Copy link
Copy link
Closed
Description
Title: isMain check fails under PM2 preventing startup
Description: When deploying compiled code (dist/index.js) using PM2, the application starts but does nothing. This is because PM2 wraps the execution, causing process.argv[1] to point to PM2's internal wrapper instead of the script file.
Location:
src/index.ts
Fix: Use a more robust check that allows for PM2's environment or filename matching.
const isMain =
executedFile === currentFile ||
(executedFile && currentFile && path.basename(executedFile) === path.basename(currentFile)) ||
!!process.env.pm_id;
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.