Skip to content

fix: don't load CI-only .github/scripts at runtime (fixes #306) - #307

Open
alikhizarsohal wants to merge 1 commit into
twilio:mainfrom
alikhizarsohal:fix/issue-306-esm-startup-crash
Open

fix: don't load CI-only .github/scripts at runtime (fixes #306)#307
alikhizarsohal wants to merge 1 commit into
twilio:mainfrom
alikhizarsohal:fix/issue-306-esm-startup-crash

Conversation

@alikhizarsohal

Copy link
Copy Markdown

Fixes #306

src/index.js eagerly require()'d two CI-only scripts (update-release, trigger-workflow) and re-exported them as releaseScripts. update-release.js requires @octokit/core, which is ESM-only, so on Node 20+ (the only Node range CLI 6.x supports) every CLI invocation crashed with ERR_REQUIRE_ESM before any command ran.

These scripts are release automation invoked directly by file path in .github/workflows/release.yml, never through the package export, and no source under src/ references releaseScripts. Removing them from the runtime entry point fixes the crash with no behavior change.

Verified on Node 20.18.0: module loads cleanly, 192 tests pass, lint clean.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

src/index.js eagerly require()'d two CI-only scripts (update-release,
trigger-workflow) and re-exported them as `releaseScripts`.
update-release.js requires @octokit/core, which is ESM-only, so on
Node 20+ (the only Node range CLI 6.x supports) every CLI invocation
crashed with ERR_REQUIRE_ESM before any command ran.

These scripts are release automation invoked directly by file path in
.github/workflows/release.yml, never through the package export, and no
source under src/ references releaseScripts. Removing them from the
runtime entry point fixes the crash with no behavior change.

Verified on Node 20.18.0: module loads cleanly, 192 tests pass, lint clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI crashes at startup with ERR_REQUIRE_ESM — src/index.js eagerly requires CI-only .github/scripts that import ESM-only @octokit/core

1 participant