Skip to content

v6.0.5 Cluster Mode not working with Bun #5963

@dienstbereit

Description

@dienstbereit

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.

  1. Create a simple Bun script (index.js):
const server = Bun.serve({
  port: 3000,
  fetch(req) {
    return new Response("Bun!");
  },
});
  1. Set up the PM2 ecosystem configuration (ecosystem.config.js):
module.exports = {
  name: "Cluster Test",
  script: "index.js",
  instances: "max",
  exec_mode: "cluster",
  watch: false,
};
  1. Start the application with PM2 using the configuration above.
  2. 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.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions