Skip to content

CI: Generate VRChat API SDK failing with ERR_REQUIRE_ESM from openapi-generator-cli #10

Description

@MineTech13

Summary
The "Generate VRChat API SDK" workflow is failing at the "Set OpenAPI Generator version" step (job 89768817411). The OpenAPI Generator CLI main.js attempts to require() proxy-agent, but an ESM-only proxy-agent is installed which causes Node to throw ERR_REQUIRE_ESM and the job to exit with code 1.

Relevant logs
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/.../node_modules/proxy-agent/dist/index.js from /home/runner/.../node_modules/@openapitools/openapi-generator-cli/main.js not supported.
Instead change the require of index.js in .../node_modules/@openapitools/openapi-generator-cli/main.js to a dynamic import() which is available in all CommonJS modules.

Workflow & run

Steps to reproduce

  1. Trigger the "Generate VRChat API SDK" workflow (or run locally with the same steps).
  2. Observe failure when running: ./node_modules/@openapitools/openapi-generator-cli/main.js version-manager set 6.2.1

Impact
Blocks automatic SDK generation and the release/tagging steps in CI.

Suggested quick fix
Force-install a CommonJS-compatible proxy-agent (v5.x) so @openapitools/openapi-generator-cli resolves a CJS proxy-agent instead of an ESM-only build. Update the workflow to create a temporary package.json with an npm "overrides" entry before installing the CLI. Example:

  • name: Prepare npm override and install OpenAPI Generator CLI
    run: |
    cat > package.json <<'JSON'
    {
    "private": true,
    "overrides": {
    "proxy-agent": "5.0.0"
    }
    }
    JSON
    npm install @openapitools/openapi-generator-cli

  • name: Set OpenAPI Generator version
    run: npx @openapitools/openapi-generator-cli version-manager set 6.2.1

Alternate fixes

  • Commit a package.json to the repo that pins proxy-agent to v5 (persistent fix).
  • Install proxy-agent@5 before the CLI install: npm install proxy-agent@5 --no-save; npm install @openapitools/openapi-generator-cli
  • Use an @openapitools/openapi-generator-cli version that depends on a CJS proxy-agent.

Notes

  • The problem is an ESM/CJS incompatibility (ERR_REQUIRE_ESM) caused by proxy-agent being distributed as an ES module while the CLI expects CommonJS.
  • This was observed on the GitHub Actions runner in the logs for job 89768817411.

Generated by Co-Pilot

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