cherry-markdown
cherry-markdown copied to clipboard
[Bug Report] main分支里面TypeScript版本问题
Prerequisites
- [X] There isn't an existing issue that reports the same bug to avoid duplicates.
- [X] The provided information offers a minimal reproducible example of the bug.
- [X] For Q&A, please open a GitHub Discussion instead.
Describe the Bug
更新main分支以后,我尝试本地构建:
npm install
npm run build
然后发现有如下错误:
node_modules/@types/lodash/common/object.d.ts:1026:46 - error TS1005: '?' expected.
1026 : K extends `${infer N extends number}` ? T[N]
~
node_modules/@types/lodash/common/object.d.ts:1031:46 - error TS1005: '?' expected.
1031 : K extends `${infer N extends number}` ? T[N]
~
node_modules/@types/lodash/common/object.d.ts:1041:46 - error TS1005: '?' expected.
1041 : K extends `${infer N extends number}`
~
Found 3 errors.
ERROR: "build:types" exited with 2.
ERROR: "build:all" exited with 1.
原因可能是 @types/lodash 里面使用了一些 TypeScript 4.7 以后才有的新语法。我将 package.json 里面的TypeScript版本改成 4.7.2 以后重新构建,可以构建成功。
如果需要,我可以创建一个PR来更新TypeScript的版本。
Reproduction Steps
No response
System Information
No response
Contributing
Yes, I would like to submit a PR for this issue.
感谢反馈,欢迎PR~~
创建了 PR:https://github.com/Tencent/cherry-markdown/pull/825