commitizen / commitizen/cz-cli

Error [ERR_REQUIRE_ESM]: require() of ES Module

Đang mở
#916 8 bình luận 11 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
17.5k
Fork
566
Merge trung bình
8 giờ 16 phút
Pull request đã merge (30 ngày)
1

Mô tả

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();
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.