easy-peasy icon indicating copy to clipboard operation
easy-peasy copied to clipboard

Easy-Peasy with TS compile error

Open a3596287 opened this issue 5 years ago • 3 comments

After I implement the TS with Easy-Peasy, and comiple, I got the follow error:

I never installed ts-toolbelt. But later I install the TS-Belt, still got the same error.

`D:xxxxxxPath/node_modules/ts-toolbelt/out/Any/At.d.ts TypeScript error in D:/GitHub/A4Me_SPA/react_a4me_2.0/node_modules/ts-toolbelt/out/Any/At.d.ts(24,121): Type expected. TS1110

22 |  * 
23 |  */

24 | export declare type At<A extends any, K extends Key> = A extends List ? number extends A['length'] ? K extends number | ${number} ? A[never] | undefined : undefined : K extends keyof A ? A[K] : undefined : unknown extends A ? unknown : K extends keyof A ? A[K] : undefined; | ^ 25 | `

my code is below: `import { Action, action, createStore, Thunk, thunk } from "easy-peasy"; import { chatCollection, chatCollectionName, } from "../../BeforeLogin2/Chat/000ChatCommonUtil"; import { IChatData } from "../../DataModal/DataModal";

interface IReduxChatArray { chatArray: IChatData[]; fetchChatArrays: Thunk; setChatArray: Action<IReduxChatArray, IChatData[]>; }

const ReduxChatArray: IReduxChatArray = { chatArray: [], fetchChatArrays: thunk(async (actions) => { let temp: IChatData[] = []; actions.setChatArray(temp); }),

setChatArray: action((state, tempChatArray) => { state.chatArray = tempChatArray; }), };

export default createStore(ReduxChatArray);`

a3596287 avatar Apr 06 '21 05:04 a3596287

I got it compiled with v3, but v5 it's not working

a3596287 avatar Apr 06 '21 05:04 a3596287

Could you please create a reproduction in CodeSandbox?

ctrlplusb avatar Oct 15 '21 07:10 ctrlplusb

I'm getting something similar here with v5. It's on a big project, but I'll see if I can replicate on something smaller

jamesecwalker avatar Oct 29 '21 09:10 jamesecwalker