dependencies: void: 0.9.0 | ts: 6.0.3, also 5.9.3
repo: https://github.com/totallynotdavid/void-env-repro
Even after void prepare, any env var accessed via c.env in a handler is typed as unknown despite being declared in env.ts.
TS2345: Argument of type 'unknown' is not assignable to parameter of type 'string'.
The cause seems to be the generated .void/env.d.ts:
type_VoidEnvShape=_VoidEnvSchemaextends{default: infer D} ? D : ...;declare module "void/handler"{interfaceCloudBindingsextends_VoidEnvShape{}}Note: this surfaces only when typeAware and typeCheck are enabled in the vite-plus lint options.
The workaround i've used:
importtype{CloudBindings}from"void/handler";declare module "void/handler"{interfaceCloudBindings{API_SECRET: string;}}
dependencies: void: 0.9.0 | ts: 6.0.3, also 5.9.3
repo: https://github.com/totallynotdavid/void-env-repro
Even after
void prepare, any env var accessed viac.envin a handler is typed asunknowndespite being declared inenv.ts.The cause seems to be the generated
.void/env.d.ts:Note: this surfaces only when
typeAwareandtypeCheckare enabled in thevite-pluslint options.The workaround i've used: