{"record":{"id":"aef7ce32379b8c99","repo":"biomejs/biome","slug":"promiseconstructor-is-missing-a-construct-signature","errorCode":null,"errorMessage":"PromiseConstructor is missing a construct signature","messagePattern":"PromiseConstructor is missing a construct signature","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/codegen/src/generate_global_types/lower.rs","lineNumber":909,"sourceCode":"        }\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 {\n        name: Text::from(\"Promise\"),\n        id_constant: \"PROMISE_ID_GLOBAL_TYPE_ID\",\n        data: LoweredTypeData::Class(LoweredClass {","sourceCodeStart":891,"sourceCodeEnd":927,"githubUrl":"https://github.com/biomejs/biome/blob/3835945f0638c88162351318b7bc8b64c5f2fba7/xtask/codegen/src/generate_global_types/lower.rs#L891-L927","documentation":"After scanning all merged declarations, the codegen requires the PromiseConstructor interface to contain at least one `new (...): Promise<...>` construct signature, tracked via saw_construct_signature. Its absence means the constructor cannot be synthesized, so lowering aborts.","triggerScenarios":"Running codegen when `interface PromiseConstructor` lacks any `new` signature, e.g. the construct signature was removed, renamed, or written as a call signature instead.","commonSituations":"Lib snapshot edits that dropped `new <T>(executor: ...): Promise<T>`; replacing a construct signature with a plain callable signature by mistake.","solutions":["Add back a `new <T>(executor: (resolve, reject) => void): Promise<T>` construct signature to the interface","Check that validate_promise_construct_signature accepts the signature's exact shape (it must not be filtered out as an overload with no body type)","Re-generate the lib snapshot from the upstream TypeScript sources if it was hand-edited"],"exampleFix":"// before\ninterface PromiseConstructor { all(...): Promise<...>; }\n// after\ninterface PromiseConstructor {\n  new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;\n  all(...): Promise<...>;\n}","handlingStrategy":"validation","validationCode":"const hasCtor = promiseConstructorDecl.members.some(m => m.type === \"ConstructSignature\");\nif (!hasCtor) throw new Error(\"interface PromiseConstructor needs a `new <T>(executor): Promise<T>` construct signature\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the canonical `new` signature when editing PromiseConstructor","Diff construct signatures across lib version bumps","Do not convert `new` signatures to plain call signatures"],"tags":["codegen","build-time","construct-signature"],"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"}