c.env.* typed as unknown after void prepare
@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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from void-sdk/void
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Incorrect bindings Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
Similar issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100