Skip to content

Commit 02bc995

Browse files
committed
fix: resolve ts-node ESM configuration issue in development mode
The GitHub Actions tests were failing with ERR_UNKNOWN_FILE_EXTENSION error when trying to run the development mode CLI. This was caused by ts-node not properly handling ESM modules in the GitHub Actions environment (Node.js v18). Fix: Add explicit --esm flag to ts-node invocation in the dev script to ensure proper handling of TypeScript files in ESM mode across different Node.js versions. This resolves the test failures in: - test/version.test.ts (2 tests) - test/pack.test.ts (1 test) All 85 tests now pass successfully. Change-Id: I8bcca3fd56e9faf9c11a9b63678175af2a04bd34 Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Jiang Xin <zhiyou.jx@alibaba-inc.com>
1 parent ccbaa8b commit 02bc995

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"build": "node scripts/build.js",
1111
"start": "ts-node src/bin/commit-msg.ts",
12-
"dev": "NODE_ENV=development NODE_OPTIONS=--no-warnings npx ts-node --project tsconfig.dev.json src/bin/commit-msg.dev.ts",
12+
"dev": "NODE_ENV=development NODE_OPTIONS=--no-warnings npx ts-node --esm --project tsconfig.dev.json src/bin/commit-msg.dev.ts",
1313
"test": "vitest run",
1414
"format": "npx prettier --write src/ test/",
1515
"lint": "npx eslint src/ test/",

0 commit comments

Comments
 (0)