Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PM2 fails to run the built .pylon/index.js #91

@ckhatton-pvfscaffolding

Description

Describe the bug
For one who wants to monitor with PM2 in a Docker image (or not with Docker), there seems to be a TypeError on executing pm2-runtime.

The app silently crashes with pm2 start as it's running inside a daemon.

The error occurs when running locally without using Docker. I can guess it's because of the old use of require(), but Pylon outputs a ESM file instead of CommonJS. Is there any way around this?

To Reproduce
Steps to reproduce the behaviour:

  1. Create a default Pylon app.
  2. Edit the last few lines of the Dockerfile to:
# Install PM2 as a project dependency (not global, due to user permissions)
RUN bun add pm2

# Run the app
USER bun
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "run", "pm2-runtime", "--interpreter", "bun", "/usr/src/pylon/.pylon/index.js" ]

Expected behavior
PM2 starts monitoring.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions