biomejs/biome · error

bogus members are not supported in the Error global

Error message

bogus members are not supported in the Error global

What it means

Emitted by the Error-global lowering (a sibling of lower_disposable_type_member around lower.rs:2530) when a member of the Error interface declaration parses as a bogus (unparseable) type member. The Error global lowering expects a strict set of member shapes and refuses anything the parser cannot classify.

Source

Thrown at xtask/codegen/src/generate_global_types/lower.rs:2530

                lower_optional_error_member_reference(&name, type_reference)?
            } else {
                type_reference
            };
            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(

View on GitHub (pinned to 3835945f06)

Solutions

  1. Open the Error declaration fixture at the reported line and fix or delete the unparseable member.
  2. Restore the member to a valid form matching the expected Error interface shape (e.g. `message: string;`, `name: string;`, `stack?: string;`).
  3. Re-run the codegen and confirm the Error global lowers without errors.

Example fix

// before (fixture)
interface Error {
  name string;
}
// after
interface Error {
  name: string;
}
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the Error fixture parses cleanly before codegen:
// cargo run -p xtask codegen 2>&1 | grep -i bogus
// Additionally check for merge markers:
//   grep -nE '^(<<<<<<<|=======|>>>>>>>)' error.d.ts

Prevention

When it happens

Trigger: Editing the Error global declaration fixture so its interface body contains syntactically invalid or truncated member text, then running `cargo run -p xtask codegen`.

Common situations: A merge conflict inside the Error d.ts fixture, a typo like `message: string` missing its separator, or copy-paste damage leaves an unparseable member in the Error interface body.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of biomejs/biome@3835945f06 (2026-09-13). Data as JSON: /api/errors/7376aec1078d7192. Report an issue: GitHub.