Skip to content

Error: ERR_REQUIRE_ESM when running ggpr config after global installΒ #86

Description

@aditi230

Hi team,

Thanks for the great work on pr-commit-ai-agent β€” it's an exciting tool for AI-powered PR workflows!

I encountered a problem after following the installation instructions in the README.

πŸ› οΈ Steps to Reproduce

  1. Installed the package globally as instructed:

    pnpm add -g pr-commit-ai-agent
  2. Installed and authenticated GitHub CLI:

    brew install gh
    gh auth login --scopes repo,read:org,read:discussion,gist
    gh auth status
  3. Ran the configuration command:

    ggpr config

❌ Error Output

/opt/homebrew/lib/node_modules/pr-commit-ai-agent/dist/run.js:315
- test: Test coverage improvements or testing framework changes
             ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /opt/homebrew/lib/node_modules/pr-commit-ai-agent/node_modules/conf/dist/source/index.js from /opt/homebrew/lib/node_modules/pr-commit-ai-agent/dist/run.js not supported.
Instead change the require of index.js in /opt/homebrew/lib/node_modules/pr-commit-ai-agent/dist/run.js to a dynamic import() which is available in all CommonJS modules.
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at Object.<anonymous> (/opt/homebrew/lib/node_modules/pr-commit-ai-agent/dist/run.js:53:27) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v22.9.0

πŸ’‘ Environment Details

  • OS: macOS (Apple Silicon)
  • Node.js version: 22.9.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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