biomejs/biome · error
metavariable members are not supported in the Error global
Error message
metavariable members are not supported in the Error global
What it means
This is a build-time error thrown by Biome's codegen xtask while lowering the TypeScript Error global type declarations into Rust code. The generator only supports a fixed set of member kinds (property, method, constructor) on the Error global; any JsMetavariable member in the source .d.ts input is rejected because metavariables (unparsed/incomplete syntax) cannot be lowered to a typed signature. It indicates the upstream type data fed to the generator is malformed or the lowering code needs a new arm.
Source
Thrown at xtask/codegen/src/generate_global_types/lower.rs:2533
};
Ok(Some(LoweredTypeMember {
name,
kind: LoweredMemberKind::Named { optional },
type_reference,
}))
}
AnyTsTypeMember::TsMethodSignatureTypeMember(_) => {
bail!("method signatures are not supported in the Error global")
}
AnyTsTypeMember::TsCallSignatureTypeMember(_)
| AnyTsTypeMember::TsConstructSignatureTypeMember(_) => {
bail!("Error global signatures must be declared on ErrorConstructor")
}
AnyTsTypeMember::JsBogusMember(_) => {
bail!("bogus members are not supported in the Error global")
}
AnyTsTypeMember::JsMetavariable(_) => {
bail!("metavariable members are not supported in the Error global")
}
AnyTsTypeMember::TsGetterSignatureTypeMember(_) => {
bail!("getter signatures are not supported in the Error global")
}
AnyTsTypeMember::TsIndexSignatureTypeMember(_) => {
bail!("index signatures are not supported in the Error global")
}
AnyTsTypeMember::TsSetterSignatureTypeMember(_) => {
bail!("setter signatures are not supported in the Error global")
}
}
}
/// Validates supported optional `Error` members.
fn lower_optional_error_member_reference(
name: &Text,
type_reference: LoweredTypeReference,
) -> Result<LoweredTypeReference> {View on GitHub (pinned to 3835945f06)
Solutions
- Fix the source type declaration so every member of the Error global is a complete, concrete TypeScript member (no parse errors).
- Re-run the parser/codegen with a current grammar so the member parses as a property/method/signature instead of a metavariable.
- If metavariable members are now legitimate, add an explicit AnyTsTypeMember::JsMetavariable handling arm in lower.rs instead of bailing.
Example fix
// before (source .d.ts fed to codegen)
interface Error {
stack?: string
// after (complete member)
interface Error {
stack?: string;
} Defensive patterns
Strategy: validation
Validate before calling
// Before running codegen, ensure the Error global source has no metavariable members
fn assert_no_metavariables(source: &str) -> Result<(), String> {
if source.trim_end().ends_with(';') || source.trim_end().ends_with('}') {
Ok(())
} else {
Err("Error global declaration contains an incomplete member".into())
}
} Type guard
fn is_concrete_member(m: &AnyTsTypeMember) -> bool {
!matches!(m, AnyTsTypeMember::JsBogusMember(_) | AnyTsTypeMember::JsMetavariable(_))
} Prevention
- Always regenerate type data from complete, committed lib .d.ts sources, never hand-edited partial files.
- Pin the grammar version used for parsing to the one the codegen expects.
- Run `just gen-grammar typescript` after parser changes before running global-types codegen.
When it happens
Trigger: Running the global-types codegen (e.g. `just gen-global-types` / xtask generate-global-types) when the parsed Error global declaration contains a member that parsed as JsMetavariable instead of a concrete AnyTsTypeMember variant.
Common situations: Feeding a truncated or syntactically incomplete TypeScript lib definition for Error into the codegen pipeline; a parser upgrade causing members of `ErrorConstructor`/`Error` to parse as metavariables; hand-editing the bundled type source and leaving an incomplete member.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- getter signatures are not supported in the Error global
- setter signatures are not supported in ErrorConstructor
- metavariables are not supported in ErrorConstructor
- generated Promise.{} member has unexpected shape
- generated {} helper has unexpected shape
AI-assisted analysis of biomejs/biome@3835945f06 (2026-09-13).
Data as JSON: /api/errors/e46cf56509e07c04.
Report an issue: GitHub.