Skip to content

fix(cli): upgrade yargs for Node.js 26 compatibility - #3203

Merged
EAGzzyCSL merged 2 commits into
mainfrom
zzy/fix-test-yargs-node26
Sep 29, 2026
Merged

EAGzzyCSL merged 2 commits into
mainfrom
zzy/fix-test-yargs-node26

Conversation

@EAGzzyCSL

Copy link
Copy Markdown
Collaborator

midscene-test create fails on Node.js 26.7.0 with require is not defined in ES module scope when loading yargs 17.7.2's extensionless CommonJS entry inside its type: module package.

Upgrade the pinned yargs dependency in @midscene/test and @midscene/cli to 17.7.3 and update the lockfile. This patch release routes require('yargs/yargs') to yargs.cjs, fixing the incompatibility without a major-version upgrade. See yargs/yargs#2509 and yargs/yargs#2514.

Validation:

  • pnpm run lint
  • pnpm exec nx run-many --target=build --projects=@midscene/test,@midscene/cli
  • pnpm exec nx test @midscene/test — 388 tests passed.
  • pnpm exec nx run-many --target=test --projects=@midscene/test,@midscene/cli — CLI tests passed; Test initially failed due to stale Core build output and passed after rebuilding dependencies with the commands above.
  • Node.js 26.7.0: pnpm --filter @midscene/test exec vitest --run --config vitest.e2e.config.ts tests/e2e/create-cli.test.ts -t 'creates a web project through the built CLI' — local smoke test passed. This test is an uncommitted local verification and is not included in this dependency-only PR.

@EAGzzyCSL
EAGzzyCSL force-pushed the zzy/fix-test-yargs-node26 branch from 5f039a9 to 2bbdfde Compare September 29, 2026 11:03
@EAGzzyCSL
EAGzzyCSL merged commit 0974a6d into main Sep 29, 2026
18 of 19 checks passed
@EAGzzyCSL
EAGzzyCSL deleted the zzy/fix-test-yargs-node26 branch September 29, 2026 11:27
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.

2 participants