commitizen / commitizen/cz-cli

Error [ERR_REQUIRE_ESM]: require() of ES Module

オープン
#916 コメント 8 件 リアクション 11 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
17.5k
フォーク
566
平均マージ
8時間 16分
マージ済み PR(30日)
1

説明

when trying to build custom commitizen prompt configs in node >14 where

```package.json
{
"type": "module",
}
```

it throws an error
```
require() of ES Module /custom-cz.js from /node_modules/commitizen/dist/commitizen/adapter.js not supported.
Instead change the require of index.js in /node_modules/commitizen/dist/commitizen/adapter.js to a dynamic import() which is available in all CommonJS modules.
```

```custom-cz.js
import { configLoader } from 'commitizen';
const config = configLoader.load();
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。