cherry-markdown icon indicating copy to clipboard operation
cherry-markdown copied to clipboard

[Bug Report] main分支里面TypeScript版本问题

Open jiakuan opened this issue 1 year ago • 2 comments

Prerequisites

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.

jiakuan avatar Jul 04 '24 02:07 jiakuan

感谢反馈,欢迎PR~~

sunsonliu avatar Jul 04 '24 03:07 sunsonliu

创建了 PR:https://github.com/Tencent/cherry-markdown/pull/825

jiakuan avatar Jul 04 '24 06:07 jiakuan