oven-sh/bun · error · Error
This type already has a default value
Error message
This type already has a default value
What it means
Error "This type already has a default value" thrown in oven-sh/bun.
Source
Thrown at src/codegen/bindgen-lib-internal.ts:567
});
}
get required() {
if (this.flags.required) {
throw new Error("This type already has required set");
}
if (this.flags.required) {
throw new Error("Cannot derive required on an optional type");
}
return new TypeImpl(this.kind, this.data, {
...this.flags,
required: true,
});
}
default(def: any) {
if ("default" in this.flags) {
throw new Error("This type already has a default value");
}
if (this.flags.required) {
throw new Error("Cannot derive default on a required type");
}
this.assertDefaultIsValid(def);
return new TypeImpl(this.kind, this.data, {
...this.flags,
default: def,
});
}
clamp(min?: number | bigint, max?: number | bigint) {
return this.#rangeModifier(min, max, "clamp");
}
enforceRange(min?: number | bigint, max?: number | bigint) {
return this.#rangeModifier(min, max, "enforce");
}View on GitHub (pinned to 8c5296ac45)
When it happens
Trigger: Thrown at src/codegen/bindgen-lib-internal.ts:567 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/6772acaa33e81f37.
Report an issue: GitHub.