Unitech / Unitech/pm2

The keyword 'package' is reserved during pm2 bundling

Open
#5,672 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

What's going wrong?

Cannot bundle pm2 due to reserved word package usage.

transforming (783) ../../node_modules/async/internal/withoutIndex.jsℹ Build end                                                                            config.vite.vite-plugin-close.js 14:45:17
SyntaxError: The keyword 'package' is reserved (21:2) in /home/user/coolProject/captcha/node_modules/pm2/lib/API/Modules/TAR.js
    at pp$4.raise (file:///home/user/coolProject/captcha/node_modules/rollup/dist/es/shared/node-entry.js:21539:13)
    at pp$5.checkUnreserved (file:///home/user/coolProject/captcha/node_modules/rollup/dist/es/shared/node-entry.js:21439:10)
    at pp$5.parsePropertyValue (file:///home/user/coolProject/captcha/node_modules/rollup/dist/es/shared/node-entry.js:21239:10)
    at pp$5.parseProperty (file:///home/user/coolProject/captcha/node_modules/rollup/dist/es/shared/node-entry.js:21198:8)
    at pp$5.parseObj (file:///home/user/coolProject/captcha/node_modules/rollup/dist/es/shared/node-entry.js:21153:21)
    at pp$5.parseExprAtom (file:///home/user/coolProject/captcha/node_modules/rollup/dist/es/shared/node-entry.js:20879:17)
    at pp$5.parseExprSubscripts (file:///home/user/coolProject/captcha/node_modules/rollup/dist/es/shared/node-entry.js:20687:19)
    at pp$5.parseMaybeUnary (file:///home/user/coolProject/captcha/node_modules/rollup/dist/es/shared/node-entry.js:20653:17)
    at pp$5.parseExprOps (file:///home/user/coolProject/captcha/node_modules/rollup/dist/es/shared/node-entry.js:20580:19)
    at pp$5.parseMaybeConditional (file:///home/user/coolProject/captcha/node_modules/rollup/dist/es/shared/node-entry.js:20563:19) {
  pos: 594,
  loc: {
    column: 2,
    file: '/home/user/coolProject/captcha/node_modules/pm2/lib/API/Modules/TAR.js',
    line: 21
  },
  raisedAt: 603,
  frame: '19:   start,\n20:   publish,\n21:   package\n      ^\n22: }',
  id: '/home/user/coolProject/captcha/node_modules/pm2/lib/API/pm2-plus/helpers.js',
  hook: 'resolveId',
  code: 'PLUGIN_ERROR',
  plugin: 'commonjs--resolver',

How could we reproduce this issue?

See reproduction here: https://stackblitz.com/edit/vitejs-vite-j8m8m3

Supporting information

                        -------------

__/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
 _\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
  _\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
   _\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
    _\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
     _\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
      _\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
       _\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
        _\///______________\///______________\///__\///////////////__


                          Runtime Edition

        PM2 is a Production Process Manager for Node.js applications
                     with a built-in Load Balancer.

                Start and Daemonize any application:
                $ pm2 start app.js

                Load Balance 4 instances of api.js:
                $ pm2 start api.js -i 4

                Monitor in production:
                $ pm2 monitor

                Make pm2 auto-boot at server restart:
                $ pm2 startup

                To go further checkout:
                http://pm2.io/


                        -------------

[PM2] Spawning PM2 daemon with pm2_home=/home/user/.pm2
[PM2] PM2 Successfully daemonized

--- PM2 report ----------------------------------------------------------------
Date                 : Wed Sep 06 2023 14:47:43 GMT+0100 (British Summer Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 5.3.0
node version         : 18.14.2
node path            : /home/user/.nvm/versions/node/v18.14.2/bin/npx
argv                 : /home/user/.nvm/versions/node/v18.14.2/bin/node,/home/user/dev/prosopo/captcha/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : chris
uid                  : 1000
gid                  : 1000
uptime               : 0min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 5.3.0
node version         : 18.14.2
node path            : /home/user/.nvm/versions/node/v18.14.2/bin/npx
argv                 : /home/user/.nvm/versions/node/v18.14.2/bin/node,/home/user/dev/prosopo/captcha/node_modules/.bin/pm2,report
argv0                : node
user                 : user
uid                  : 1000
gid                  : 1000
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : linux
type                 : Linux
cpus                 : AMD FX(tm)-8350 Eight-Core Processor
cpus nb              : 8
freemem              : 8519884800
totalmem             : 33622290432
home                 : /home/user
===============================================================================
--- PM2 list -----------------------------------------------
┌────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name      │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
└────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/user/.pm2/pm2.log last 20 lines:
PM2        | 2023-09-06T14:47:43: PM2 log: ===============================================================================
PM2        | 2023-09-06T14:47:43: PM2 log: --- New PM2 Daemon started ----------------------------------------------------
PM2        | 2023-09-06T14:47:43: PM2 log: Time                 : Wed Sep 06 2023 14:47:43 GMT+0100 (British Summer Time)
PM2        | 2023-09-06T14:47:43: PM2 log: PM2 version          : 5.3.0
PM2        | 2023-09-06T14:47:43: PM2 log: Node.js version      : 18.14.2
PM2        | 2023-09-06T14:47:43: PM2 log: Current arch         : x64
PM2        | 2023-09-06T14:47:43: PM2 log: PM2 home             : /home/user/.pm2
PM2        | 2023-09-06T14:47:43: PM2 log: PM2 PID file         : /home/user/.pm2/pm2.pid
PM2        | 2023-09-06T14:47:43: PM2 log: RPC socket file      : /home/user/.pm2/rpc.sock
PM2        | 2023-09-06T14:47:43: PM2 log: BUS socket file      : /home/user/.pm2/pub.sock
PM2        | 2023-09-06T14:47:43: PM2 log: Application log path : /home/user/.pm2/logs
PM2        | 2023-09-06T14:47:43: PM2 log: Worker Interval      : 30000
PM2        | 2023-09-06T14:47:43: PM2 log: Process dump file    : /home/user/.pm2/dump.pm2
PM2        | 2023-09-06T14:47:43: PM2 log: Concurrent actions   : 2
PM2        | 2023-09-06T14:47:43: PM2 log: SIGTERM timeout      : 1600
PM2        | 2023-09-06T14:47:43: PM2 log: ===============================================================================

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pm2/lib/API/Modules/TAR.js at line 21 and the pm2-plus helper path shown in the Rollup error; run the linked StackBlitz reproduction with pm2 5.3.0, Node 18.14.2, and the reported Vite/Rollup setup. Done means the reproduction bundles successfully without the reserved-word syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs, rollup, vite
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.