{"record":{"id":"446c229b0afae730","repo":"biomejs/biome","slug":"promise-is-missing","errorCode":null,"errorMessage":"Promise is missing {}","messagePattern":"Promise is missing (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/codegen/src/generate_global_types/lower.rs","lineNumber":913,"sourceCode":"            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 {\n            name: Text::from(\"Promise\"),\n            type_parameters: Box::new([LoweredTypeReference::Predefined(\"GLOBAL_T_ID\")]),\n            members,\n        }),","sourceCodeStart":895,"sourceCodeEnd":931,"githubUrl":"https://github.com/biomejs/biome/blob/3835945f0638c88162351318b7bc8b64c5f2fba7/xtask/codegen/src/generate_global_types/lower.rs#L895-L931","documentation":"The lowering compares the methods found on Promise/PromiseConstructor against a fixed PROMISE_METHOD_SPECIFICATIONS table (with PROMISE_METHOD_COUNT entries). If any required specification (identified by specification.global_name) was not observed on either the instance or static side, this error names the missing method and aborts.","triggerScenarios":"Running generate_global_types when a required Promise method (e.g. then, catch, finally, resolve, reject, all, allSettled, any, race) is missing, optional, or renamed in the lib sources.","commonSituations":"A TypeScript lib version bump that removes or moves a method (e.g. finally living only in lib.es2018); a snapshot prune that dropped methods; an extension header (like bluebird-style helpers) altering the shape.","solutions":["Restore the missing method to the Promise interface or PromiseConstructor interface in the lib sources","Update PROMISE_METHOD_SPECIFICATIONS / PROMISE_METHOD_COUNT in lower.rs if the required set intentionally changed","Check target lib configuration (es2015 vs es2018 etc.) so the snapshot includes all required methods"],"exampleFix":"// before\ninterface Promise<T> { then(...): ...; }\n// after\ninterface Promise<T> { then(...): ...; catch(...): ...; finally(...): ...; }","handlingStrategy":"validation","validationCode":"const REQUIRED = [\"then\",\"catch\",\"finally\",\"resolve\",\"reject\",\"all\",\"allSettled\",\"any\",\"race\"];\nconst names = new Set([...promiseDecl.members, ...promiseConstructorDecl.members].map(m => m.name));\nconst missing = REQUIRED.filter(n => !names.has(n));\nif (missing.length) throw new Error(\"Snapshot is missing Promise methods: \" + missing.join(\", \"));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the Promise method set in sync with PROMISE_METHOD_SPECIFICATIONS","Check which lib targets are included so es2018+ methods (finally, allSettled, any) are present","Run the codegen after every lib snapshot change and inspect the specific missing-method message"],"tags":["codegen","build-time","api-surface"],"backgroundTag":"schema-validation-failed","analyzedSha":"3835945f0638c88162351318b7bc8b64c5f2fba7","analyzedAt":"2026-09-13T15:11:16.919Z","contentChangedAt":"2026-09-13T15:11:16.919Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}