hyperweb-io / hyperweb-io/ts-codegen

Weird type issue

Abierto
#95 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
126
Forks
31
Merge medio
19 min
PR fusionados (30 d)
2

Descripción

While generating the schema for a query message that returns `Option`, 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;
~~~~~~~~~~~~~~~~

contracts/cw-vesting/CwVesting.client.ts:81:36 - error TS2552: Cannot find name 'NullableDuration'. Did you mean 'Nullable_Duration'?

81 vestDuration = async (): Promise => {
~~~~~~~~~~~~~~~~
```

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](https://github.com/DA0-DA0/dao-contracts/actions/runs/4358741481/jobs/7619698495) has a branch on which this fails. You can reproduce the issue by checking out that branch and running ts-codegen with `just gen`.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Check out the linked reproduction branch and run `just gen` to inspect the generated `contracts/cw-vesting/CwVesting.client.ts`. Trace how the `Option` query return type becomes `Nullable_Duration` while its uses become `NullableDuration`; done means the generated client consistently references the declared type and compiles without the reported TypeScript errors.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
tooling
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.