pro-components
pro-components copied to clipboard
Getting an error Type error: Type parameter declaration expected. 🐛[BUG]
Failed to compile. ./node_modules/@ant-design/pro-form/es/components/FormItemRender/index.d.ts:24:41 Type error: Type parameter declaration expected. 22 | }[]> = T[number]['name']; 23 | export declare function useControlModel<T extends FormControlProps>({ value, onChange, id }: WithControlPropsType, model?: T): ControlModelType;
24 | export declare function useControlModel<const T extends readonly string[]>({ value, onChange, id }: WithControlPropsType, model?: T): { | ^ 25 | [P in T[number]]: ControlModelType; 26 | }; 27 | export declare function useControlModel<const T extends readonly FormControlMultiProps[]>({ value, onChange, id }: WithControlPropsType, model?: T): { -----> Build failed
Note this is using heroku
any ideas?
Probably a ts version issue,‘const T’ needs ts version 5.0 or later.
I also happen to have this issue after building for deployment. I'm using @ant-design/pro-components version ^2.6.49 for Antd version 5.2.1. Has anyone been able to build for production?
I also happen to have this issue after building for deployment. I'm using @ant-design/pro-components version ^2.6.49 for Antd version 5.2.1. Has anyone been able to build for production?
Try to update Typescript v5.0 or later
@DuyVoK15 I have tsc 5.4.2 already installed.
Probably a ts version issue,‘const T’ needs ts version 5.0 or later.
It's the right one. Solved my problem.
I'm running into this issue as well using the latest version of pro-components
(2.7.11) and typescript
(5.5.2). I've also tried pinning to lower versions of typescript v5, like 5.3.3 referenced in the lockfile, but the same errors are present when building.
I'm seeing 20 cases of these, all coming from @ant-design/pro-form/es/components/FormItemRender/index.d.ts
:
- 24:41 - error TS1139: Type parameter declaration expected.
- 24:49 - error TS1005: ',' expected.
- 24:129 - error TS1109: Expression expected.
- 24:133 - error TS1128: Declaration or statement expected.
Any ideas?
I have the same problem. Any ideas?
I'm running into this issue as well using the latest version of
pro-components
(2.7.11) andtypescript
(5.5.2). I've also tried pinning to lower versions of typescript v5, like 5.3.3 referenced in the lockfile, but the same errors are present when building.I'm seeing 20 cases of these, all coming from
@ant-design/pro-form/es/components/FormItemRender/index.d.ts
:
- 24:41 - error TS1139: Type parameter declaration expected.
- 24:49 - error TS1005: ',' expected.
- 24:129 - error TS1109: Expression expected.
- 24:133 - error TS1128: Declaration or statement expected.
Any ideas?
我安装5.5.4版本的可以