c.env.* typed as unknown after void prepare
@TheAlexLichter đang làm issue này rồi.
Từ ngày 29/5/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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;
}
}
- Ngôn ngữ chính
- TypeScript
- Star
- 149
- Fork
- 2
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của void-sdk/void
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Incorrect bindings Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
Tất cả issue của void-sdk/void
Issue tương tự
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100