Skip to content

fix: remove node-abort-controller polyfill breaking Node 24 compatibility#927

Merged
pru55e11 merged 1 commit into
masterfrom
fix/ACNA-4621-remove-node-abort-controller-polyfill
May 22, 2026
Merged

fix: remove node-abort-controller polyfill breaking Node 24 compatibility#927
pru55e11 merged 1 commit into
masterfrom
fix/ACNA-4621-remove-node-abort-controller-polyfill

Conversation

@pru55e11
Copy link
Copy Markdown
Contributor

Summary

  • Removes the node-abort-controller polyfill from src/BaseCommand.js (lines 13-14) that globally replaced the native AbortController
  • Removes node-abort-controller from package.json dependencies
  • Fixes aio app init crashing on Node 24 with ERR_INVALID_ARG_TYPE: The "eventTargets" argument must be an instance of EventEmitter or EventTarget

Root cause: Node 24 tightened validation in events.setMaxListeners() to require true EventEmitter/EventTarget instances. The polyfill's AbortSignal is a plain object, so oclif/core calling setMaxListeners with the abort signal during command init triggers the error. The polyfill was originally added for Node ≤16.13 compatibility and has been unnecessary since engines.node was bumped to >=20.

Fixes ACNA-4621

Test plan

  • 834 existing tests pass (pre-existing test/commands/app/test.test.js SIGSEGV is unrelated, reproduces on master without this change)
  • nvm use 24 && aio app init <name> no longer crashes during post-template npm install
  • nvm use 22 still works as expected

…ility

Node 24 tightened validation in events.setMaxListeners() to require true
EventEmitter/EventTarget instances. The node-abort-controller polyfill's
AbortSignal is a plain object, causing ERR_INVALID_ARG_TYPE crashes during
aio app init. The polyfill was added for Node <=16.13 compat and is no
longer needed since engines.node is >=20.

Fixes ACNA-4621
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 PR Reviewer

This diff removes the node-abort-controller polyfill dependency and its global assignment. This is a clean, positive change assuming the minimum supported Node.js version is 15+ (where AbortController is globally available natively) or 16.17+/18+ (where it is unflagged/stable). No issues found.

LGTM! This PR looks good to merge.


💡 How to re-trigger

Comment /review or /pr-reviewer on this PR

@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@pru55e11 pru55e11 merged commit f495c4e into master May 22, 2026
10 checks passed
@pru55e11 pru55e11 deleted the fix/ACNA-4621-remove-node-abort-controller-polyfill branch May 22, 2026 19:22
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.

3 participants