{"record":{"id":"84e60db2e34d31f0","repo":"biomejs/biome","slug":"promise-global-must-include-an-interface-declaration","errorCode":null,"errorMessage":"Promise global must include an interface declaration","messagePattern":"Promise global must include an interface declaration","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/codegen/src/generate_global_types/lower.rs","lineNumber":852,"sourceCode":"\n        let declaration = source_cache\n            .find_interface_declaration(record)?\n            .with_context(|| {\n                format!(\n                    \"failed to find interface declaration {} at {:?}\",\n                    record.declared_name.text(),\n                    record.text_range\n                )\n            })?;\n        validate_promise_interface(&declaration)?;\n        validate_promise_methods(\n            &declaration,\n            PromiseMemberLocation::Instance,\n            &mut saw_methods,\n        )?;\n    }\n    if !saw_promise_interface {\n        bail!(\"Promise global must include an interface declaration\");\n    }\n\n    let Some(constructor_group) = manifest.global_group(\"PromiseConstructor\") else {\n        bail!(\"Promise global value side references missing PromiseConstructor group\");\n    };\n    if !constructor_group.has_role(GlobalDeclarationRole::Type) {\n        bail!(\"PromiseConstructor must have a type-side declaration\");\n    }\n\n    let mut saw_constructor_interface = false;\n    let mut saw_construct_signature = false;\n    for record in constructor_group.declarations() {\n        match &record.kind {\n            DeclarationKind::Interface => saw_constructor_interface = true,\n            DeclarationKind::TypeAlias => {\n                bail!(\"type aliases are not supported in PromiseConstructor\")\n            }\n            DeclarationKind::DeclareFunction","sourceCodeStart":834,"sourceCodeEnd":870,"githubUrl":"https://github.com/biomejs/biome/blob/3835945f0638c88162351318b7bc8b64c5f2fba7/xtask/codegen/src/generate_global_types/lower.rs#L834-L870","documentation":"After walking all declarations in the 'Promise' global group, the codegen checks that at least one was an interface (the `interface Promise<T>` declaration). If none was seen, the Promise instance-side methods cannot be anchored to a type and lowering fails with this error.","triggerScenarios":"Running `cargo xtask codegen` when the Promise group's records contain no DeclarationKind::Interface — e.g. the interface was removed, renamed away from the group, or misclassified during manifest construction.","commonSituations":"Deleting `interface Promise<T>` while keeping the `declare var Promise`; a parsing/role-extraction change stops mapping the interface record into the Promise group; moving the interface into another global group.","solutions":["Ensure the global typings source declares `interface Promise<T>` inside the Promise global group.","Verify the manifest builder classifies that interface with DeclarationKind::Interface in the Promise group.","Regenerate and re-run `cargo xtask codegen`."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Confirm an interface record exists in the Promise group\nfn has_promise_interface(group: &GlobalGroup) -> bool {\n  group.declarations().iter().any(|r| matches!(r.kind, DeclarationKind::Interface))\n}\nif !has_promise_interface(promise_group) { bail!(\"Promise group lacks interface declaration\"); }","typeGuard":null,"tryCatchPattern":"if let Err(e) = lower_promise_globals(&manifest, &mut globals, &source_cache) {\n  if e.to_string().contains(\"must include an interface declaration\") {\n    eprintln!(\"Restore `interface Promise<T>` in the Promise global group and rerun codegen\");\n    std::process::exit(1);\n  }\n  return Err(e.into());\n}","preventionTips":["Keep `interface Promise<T>` present whenever Promise declarations are edited.","Add a manifest-level assertion that the Promise group contains an Interface record.","Check manifest grouping after changes to declaration parsing/extraction.","Inspect regenerated manifests in code review."],"tags":["codegen","rust","build","typescript-globals"],"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"}