-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
I’m experiencing an issue where PM2 version 6.0.5 does not seem to work in Cluster Mode with Bun, even though the release notes mention that Bun should be compatible with PM2 now.
- Create a simple Bun script (
index.js
):
const server = Bun.serve({
port: 3000,
fetch(req) {
return new Response("Bun!");
},
});
- Set up the PM2 ecosystem configuration (
ecosystem.config.js
):
module.exports = {
name: "Cluster Test",
script: "index.js",
instances: "max",
exec_mode: "cluster",
watch: false,
};
- Start the application with PM2 using the configuration above.
- Check the PM2 logs.
Expected Behavior: The application should run in Cluster Mode, with instances of Bun being spawned as specified in the ecosystem.config.js file.
Actual Behavior: There are no errors in the PM2 logs, but the application does not seem to function as expected in Cluster Mode. The cluster instances are not being spawned, or the application is not responding properly.
Environment:
PM2 Version: 6.0.5
Bun Version: v1.2.5
Node.js Version: v23.6.0
OS: Linux Ubuntu x86_64 x86_64 x86_64 GNU/Linux
Additional Context:
PM2 does not show any error messages in the logs.
The issue only occurs in Cluster Mode, and switching to fork mode seems to work fine with Bun.