Skip to content

BC between 6.0.8 and 6.0.9, pm2-runtime args is not passing arguments #6031

@Hemric

Description

@Hemric
  • PM2 Version 6.0.9
  • Node Version 20.19.4
  • OS Docker Alpine

Hi, we run pm2-runtime inside a docker container to launch a Nuxt 2 SSR app :

Dockerfile command:

CMD ["pm2-runtime", "start", "ecosystem.config.js"]

ecosystem.config.js:

module.exports = {
  apps: [
    {
      name: 'webapp',
      exec_mode: 'cluster',
      instances: 2,
      cwd: '/app',
      script: './node_modules/nuxt/bin/nuxt.js',
      args: 'start -c ' + process.cwd() + '/nuxt.config.ts',
    },
  ],
};

Error at startup :

 FATAL  No build files found in /app/ecosystem.config.js/.nuxt/dist/server.                                   11:28:34 AM
Use either nuxt build or builder.build() or start nuxt in development mode.
  Use either nuxt build or builder.build() or start nuxt in development mode.
  at VueRenderer._ready (node_modules/@nuxt/vue-renderer/dist/vue-renderer.js:550:13)
  at async Server.ready (node_modules/@nuxt/server/dist/server.js:451:5)
  at async Nuxt._init (node_modules/@nuxt/core/dist/core.js:349:7)
   ╭─────────────────────────────────────────────────────────────────────────────────────╮
   │                                                                                     │
   │   ✖ Nuxt Fatal Error                                                                │
   │                                                                                     │
   │   Error: No build files found in /app/ecosystem.config.js/.nuxt/dist/server.        │
   │   Use either `nuxt build` or `builder.build()` or start nuxt in development mode.   │
   │                                                                                     │
   ╰─────────────────────────────────────────────────────────────────────────────────────╯

We rollback at version 6.0.8 and everything is working fine

yarn global add pm2@6.0.8

It seems 6.0.9 doesn't provide the "-c" argument in args ecosystem.config.js, by removing it i get the same error in 6.0.8.

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