LearnNewsExamplesServices
Frontmatter
id14387
titleCommander 15 breaks buildScripts ESM imports
stateClosed
labels
bugdependenciesaibuild
assigneesneo-gpt
createdAtJul 1, 2026, 1:10 AM
updatedAtJul 1, 2026, 5:40 AM
githubUrlhttps://github.com/neomjs/neo/issues/14387
authorneo-gpt
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJul 1, 2026, 5:40 AM

Commander 15 breaks buildScripts ESM imports

Closed v13.1.0/archive-v13-1-0-chunk-8 bugdependenciesaibuild
neo-gpt
neo-gpt commented on Jul 1, 2026, 1:10 AM

Context

The dependency update on origin/dev moved Commander to 15.0.0. Current CI for PR #14386 now fails in the unit job before completing the suite because several buildScripts/** modules still import commander/esm.mjs.

Live latest-open sweep: checked the latest 20 open issues at 2026-06-30T23:12Z; no equivalent Commander 15 / commander/esm.mjs buildScripts compatibility ticket found. Exact GitHub duplicate searches for commander esm.mjs and ERR_PACKAGE_PATH_NOT_EXPORTED commander returned zero open issues. A2A in-flight sweep: checked latest 30 all-state messages at 2026-06-30T23:12Z; no overlapping buildScripts/Commander lane claim found.

The Problem

V-B-A proves the new Commander package no longer exports the historical subpath:

  • Local npm run agent-preflight -- <changed files> fails before checking files with ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './esm.mjs' is not defined by "exports" in node_modules/commander/package.json from buildScripts/util/agent-preflight.mjs.
  • GitHub Actions unit job 84419181573 for PR #14386 fails with the same ERR_PACKAGE_PATH_NOT_EXPORTED class from buildScripts/docs/index/discussions.mjs, tickets.mjs, release.mjs, docs/seo/generate.mjs, and util/agent-preflight.mjs.
  • Repo sweep shows AI scripts already import Commander from commander, while multiple build scripts still import from commander/esm.mjs.

The Architectural Reality

Commander is the CLI parser dependency shared by build scripts, creation scripts, docs index/SEO helpers, and the local agent preflight helper. Commander 15 exposes the package root for ESM named imports; it does not expose the old commander/esm.mjs subpath. The owning substrate is therefore the buildScripts import surface, not the AI MCP schema layer.

The Fix

  • Replace import {Command} from 'commander/esm.mjs' in buildScripts/** with import {Command} from 'commander'.
  • Keep call sites and CLI behavior unchanged.
  • Verify the previously failing buildScripts entry points can import under the updated dependency set.
  • Re-run local agent preflight and current PR unit CI after the fix.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
BuildScripts Commander imports buildScripts/** CLI modules Import Command from the package root supported by Commander 15 Import-time failure blocks unit CI and local agent preflight Existing CLI code comments/JSDoc Direct Node import probes + CI unit failure log

Decision Record impact

none

Acceptance Criteria

  • No buildScripts/** module imports commander/esm.mjs.
  • Previously failing buildScripts modules import successfully under Commander 15.
  • npm run agent-preflight -- <changed files> gets past the Commander import boundary.
  • PR #14386 unit CI no longer fails on ERR_PACKAGE_PATH_NOT_EXPORTED from Commander.

Out of Scope

  • No redesign of build scripts or CLI behavior.
  • No package version change.
  • No AI MCP/Zod schema changes; those remain covered by #14385.

Avoided Traps

  • Do not downgrade Commander to preserve a removed subpath; the repo already uses root commander ESM imports successfully in ai/** scripts.
  • Do not treat this as a test flake; both local preflight and GitHub CI fail deterministically at import time.

Related

Related: PR #14386 Related: #14385

Origin Session ID: 019f18b1-1b14-7900-a06f-8ffdc43790b1

Handoff Retrieval Hint: "Commander 15 commander/esm.mjs ERR_PACKAGE_PATH_NOT_EXPORTED buildScripts unit CI agent-preflight"

tobiu referenced in commit 4ef021a - "fix(ai): restore Zod v4 MCP schema emission (#14385) (#14386) on Jul 1, 2026, 5:40 AM
tobiu closed this issue on Jul 1, 2026, 5:40 AM