Weird type issue
Opened this issue · 1 comments
0xekez commented
While generating the schema for a query message that returns Option<cw_utils::Duration>, ts-codegen fails with:
contracts/cw-vesting/CwVesting.client.ts:25:31 - error TS2552: Cannot find name 'NullableDuration'. Did you mean 'Nullable_Duration'?
25 vestDuration: () => Promise<NullableDuration>;
~~~~~~~~~~~~~~~~
contracts/cw-vesting/CwVesting.client.ts:81:36 - error TS2552: Cannot find name 'NullableDuration'. Did you mean 'Nullable_Duration'?
81 vestDuration = async (): Promise<NullableDuration> => {
~~~~~~~~~~~~~~~~
It appears that it generates a type Nullable_Duration that is correct, and the uses a different one NullableDuration as the query return value. This CI job has a branch on which this fails. You can reproduce the issue by checking out that branch and running ts-codegen with just gen.
pyramation commented
thanks @0xekez — can you provide the schema?