atzcl / z

基于 MidwayJS(EggJS) + TypeScript 的多模块应用 [ NodeJS 版 ]
129 stars 20 forks source link

ts error 7053 #25

Closed taco-wang closed 4 years ago

taco-wang commented 4 years ago

我就clone 了这个项目 复制了config.default.ts yarn Dev image src/app/extend/helper.ts(240,11): error TS7053: Element implicitly has an 'any' type because expression of type '"pidField"' can't be used to index type 'unknown'. Property 'pidField' does not exist on type 'unknown'. src/app/extend/helper.ts(245,16): error TS2339: Property 'value' does not exist on type 'V'. src/app/extend/helper.ts(245,24): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'unknown'. No index signature with a parameter of type 'string' was found on type 'unknown'. src/app/extend/helper.ts(246,16): error TS2339: Property 'label' does not exist on type 'V'. src/app/extend/helper.ts(246,24): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'unknown'. No index signature with a parameter of type 'string' was found on type 'unknown'. src/app/extend/helper.ts(252,9): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'unknown'. No index signature with a parameter of type 'string' was found on type 'unknown'. src/app/extend/helper.ts(256,32): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'unknown'. No index signature with a parameter of type 'string' was found on type 'unknown'.

atzcl commented 4 years ago

你的 typescript/ts-node 的版本分别是?

taco-wang commented 4 years ago

typescirpt ^3.8.3 "ts-node": "^8.9.0",

atzcl commented 4 years ago

ts 的版本导致的,已经修正,更新下代码试一下~