Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

c.env.* typed as unknown after void prepare

Open
#53 0 comments 0 reactions 1 assignee View on GitHub

@TheAlexLichter is already working on this.

Since May 29, 2026.

Assessment

This issue has not been assessed yet.

Description

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 = _VoidEnvSchema extends { default: infer D } ? D : ...;

declare module "void/handler" {
  interface CloudBindings extends _VoidEnvShape {}
}

Note: this surfaces only when typeAware and typeCheck are enabled in the vite-plus lint options.

The workaround i've used:

import type { CloudBindings } from "void/handler";

declare module "void/handler" {
  interface CloudBindings {
    API_SECRET: string;
  }
}
Dominant language
TypeScript
Stars
149
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from void-sdk/void

All issues in void-sdk/void

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.