biomejs/biome · error

PromiseConstructor extends clauses are not supported

Error message

PromiseConstructor extends clauses are not supported

What it means

The codegen requires the merged PromiseConstructor interface to have no extends clause, because validate_promise_methods checks members only against a fixed PROMISE_METHOD_SPECIFICATIONS list and an inherited member would be invisible to that check. If the interface extends another interface, lowering aborts with this error.

Source

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

            }
            DeclarationKind::DeclareFunction
            | DeclarationKind::VariableDeclarator { .. }
            | DeclarationKind::ImportEquals => {
                bail!("value-side PromiseConstructor declarations are not supported")
            }
        }

        let declaration = source_cache
            .find_interface_declaration(record)?
            .with_context(|| {
                format!(
                    "failed to find interface declaration {} at {:?}",
                    record.declared_name.text(),
                    record.text_range
                )
            })?;
        if declaration.extends_clause().is_some() {
            bail!("PromiseConstructor extends clauses are not supported");
        }
        if declaration.type_parameters().is_some() {
            bail!("PromiseConstructor type parameters are not supported");
        }

        validate_promise_methods(
            &declaration,
            PromiseMemberLocation::Static,
            &mut saw_methods,
        )?;
        for member in declaration.members() {
            if let AnyTsTypeMember::TsConstructSignatureTypeMember(member) = member {
                validate_promise_construct_signature(&member)?;
                saw_construct_signature = true;
            }
        }
    }
    if !saw_constructor_interface {

View on GitHub (pinned to 3835945f06)

Solutions

  1. Inline the inherited members into PromiseConstructor and remove the extends clause in the lib sources
  2. Add support for extends clauses in the PromiseConstructor lowering path
  3. Pin lib sources to a version where PromiseConstructor does not extend anything

Example fix

// before
interface PromiseConstructor extends PromiseExtras { ... }
// after
interface PromiseConstructor { /* members of PromiseExtras inlined */ ... }
Defensive patterns

Strategy: validation

Validate before calling

if (promiseConstructorDecl.extendsClause) {
  throw new Error("Inline inherited members into interface PromiseConstructor before running codegen");
}

Prevention

When it happens

Trigger: Running generate_global_types when lib sources define `interface PromiseConstructor extends SomeBase { ... }`.

Common situations: TypeScript lib updates introducing a heritage clause on PromiseConstructor; vendor lib snapshots that merge extra interfaces via extends.

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


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