commitizen / commitizen/cz-cli
regression: Pnpm `wrap-ans` require() of ES Module error
- 主要语言
- JavaScript
- 星标
- 17.5k
- 派生
- 566
- 平均合并
- 8 小时 16 分钟
- 30 天内合并 PR
- 1
描述
### Description
`cz-cli` dependency `wrap-ans` does not import properly, causing error when running `pnpm commit`
**package.json**
```Json
{
"type": "module",
"scripts": {
"commit": "cz",
...
},
...
}
```
**error in cli**
```Bash
require() of ES Module /Users/menglinmaker/Documents/2-Engineering/OpenSource/npm-library-boilerplate/node_modules/wrap-ansi/node_modules/string-width/index.js from /Users/menglinmaker/Documents/2-Engineering/OpenSource/npm-library-boilerplate/node_modules/wrap-ansi/index.js not supported.
Instead change the require of /Users/menglinmaker/Documents/2-Engineering/OpenSource/npm-library-boilerplate/node_modules/wrap-ansi/node_modules/string-width/index.js in /Users/menglinmaker/Documents/2-Engineering/OpenSource/npm-library-boilerplate/node_modules/wrap-ansi/index.js to a dynamic import() which is available in all CommonJS modules.
```
Note: using `"type": "commonjs"` leads to the same result
### Additional details
This issue only occurs on `commitizen@4.2.5` and after.
I found `commitizen@4.2.2` to behave exactly how I liked.
贡献指南
评估
这个 Issue 还没有评估数据。