Frontity in cluster mode with PM2

Hello, I am trying to start a project with frontity and dockers and make it work with PM2. In Fork mode there is no problem but in cluster mode there is no way to make it work, the process does not start. From what I have been able to investigate the error that PM2 returns occurs when trying to cluster binary files, since cluster mode only works with pure nodejs applications. Are there any limitations regarding cluster mode in frontity?
Thank you.

start command: pm2 start ecosystem.config.js --no-daemon

module.exports = {
    apps : [{
      name: "prueba",
      script: "npm run dev",
      merge_logs: true,
      max_restarts: 5,
      instances: 2,
      exec_mode: "cluster",
      autorestart: true,
      wait_ready: true,
      automation: false,
      max_memory_restart: "1G",
      broadcast_logs: true,
      env: {
        NODE_ENV: "development",
      env_production: {
        NODE_ENV: "production",
Error trace:
0| | ELF
0| | ^
0| | SyntaxError: Invalid or unexpected token
0| |     at wrapSafe (internal/modules/cjs/loader.js:1054:16)
0| |     at Module._compile (internal/modules/cjs/loader.js:1102:27)
0| |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
0| |     at Module.load (internal/modules/cjs/loader.js:986:32)
0| |     at Function.Module._load (internal/modules/cjs/loader.js:879:14)
0| |     at /usr/local/lib/node_modules/pm2/lib/ProcessContainer.js:303:25

Not that I am aware of, but maybe there’s something in the WebpackDevServer package. Is there a reason you’re running this in dev mode instead of production mode?

You can start a server in production mode using npx frontity serve, after running npx frontity build.

Hello, I have tried in production mode, as you say and the error of PM2 is the same. I understand that the problem may come from having some binary inside the package since PM2 in cluster mode does not work with binaries. In the end we have created the cluster from NodeJS generating forks of the main thread and balancing them with the nginx.
Thank you.

I’m glad you’ve solved it, @debian.olwe. If you find out which node is causing the problem let us know and we’ll investigate :slightly_smiling_face: