{"record":{"id":"cfee50ffe793aec5","repo":"biomejs/biome","slug":"promiseconstructor-must-include-an-interface-declaration","errorCode":null,"errorMessage":"PromiseConstructor must include an interface declaration","messagePattern":"PromiseConstructor must include an interface declaration","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/codegen/src/generate_global_types/lower.rs","lineNumber":906,"sourceCode":"        }\n        if declaration.type_parameters().is_some() {\n            bail!(\"PromiseConstructor type parameters are not supported\");\n        }\n\n        validate_promise_methods(\n            &declaration,\n            PromiseMemberLocation::Static,\n            &mut saw_methods,\n        )?;\n        for member in declaration.members() {\n            if let AnyTsTypeMember::TsConstructSignatureTypeMember(member) = member {\n                validate_promise_construct_signature(&member)?;\n                saw_construct_signature = true;\n            }\n        }\n    }\n    if !saw_constructor_interface {\n        bail!(\"PromiseConstructor must include an interface declaration\");\n    }\n    if !saw_construct_signature {\n        bail!(\"PromiseConstructor is missing a construct signature\");\n    }\n    for (index, specification) in PROMISE_METHOD_SPECIFICATIONS.iter().enumerate() {\n        if !saw_methods[index] {\n            bail!(\"Promise is missing {}\", specification.global_name);\n        }\n    }\n\n    let members = std::iter::once(LoweredTypeMember {\n        name: Text::from(\"constructor\"),\n        kind: LoweredMemberKind::Constructor,\n        type_reference: LoweredTypeReference::Predefined(\"GLOBAL_PROMISE_CONSTRUCTOR_ID\"),\n    })\n    .chain(PROMISE_METHOD_SPECIFICATIONS.map(promise_member))\n    .collect();\n    globals.push(LoweredGlobal {","sourceCodeStart":888,"sourceCodeEnd":924,"githubUrl":"https://github.com/biomejs/biome/blob/3835945f0638c88162351318b7bc8b64c5f2fba7/xtask/codegen/src/generate_global_types/lower.rs#L888-L924","documentation":"The lowering loop expects at least one record in the PromiseConstructor declaration group to be an interface declaration providing the members to validate and lower. If every record is some other kind (or the group is otherwise interface-less), the saw_constructor_interface flag stays false and this error aborts the codegen.","triggerScenarios":"Running generate_global_types when no `interface PromiseConstructor` exists among the merged declarations, e.g. the interface was renamed, removed, or converted to a type alias.","commonSituations":"Deleting or renaming the interface during lib snapshot maintenance; a lib version where PromiseConstructor is expressed without an interface declaration.","solutions":["Restore `interface PromiseConstructor { ... }` in the lib sources","Update PROMISE declaration handling in lower.rs to locate the interface under a different shape","Check the lib snapshot for accidental interface deletion during a version bump"],"exampleFix":"// before (lib .d.ts) — interface removed, only `declare var Promise` remains\ndeclare var Promise: { new <T>(...): Promise<T>; ... };\n// after\ninterface PromiseConstructor { new <T>(...): Promise<T>; all(...): Promise<...>; ... }\ndeclare var Promise: PromiseConstructor;","handlingStrategy":"validation","validationCode":"const hasInterface = group.declarations().some(d => d.kind === \"Interface\");\nif (!hasInterface) throw new Error(\"No interface PromiseConstructor found in the declaration group\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify the interface survives lib snapshot regeneration","Grep snapshots for `interface PromiseConstructor` after every bump","Never delete the constructor interface when pruning unused declarations"],"tags":["codegen","build-time","declaration-merging"],"backgroundTag":"missing-required-argument","analyzedSha":"3835945f0638c88162351318b7bc8b64c5f2fba7","analyzedAt":"2026-09-13T15:11:16.919Z","contentChangedAt":"2026-09-13T15:11:16.919Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}