{"record":{"id":"76a895b015aaa4e0","repo":"biomejs/biome","slug":"promise-global-value-side-references-missing","errorCode":null,"errorMessage":"Promise global value side references missing PromiseConstructor group","messagePattern":"Promise global value side references missing PromiseConstructor group","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/codegen/src/generate_global_types/lower.rs","lineNumber":856,"sourceCode":"                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\n            | DeclarationKind::VariableDeclarator { .. }\n            | DeclarationKind::ImportEquals => {\n                bail!(\"value-side PromiseConstructor declarations are not supported\")\n            }","sourceCodeStart":838,"sourceCodeEnd":874,"githubUrl":"https://github.com/biomejs/biome/blob/3835945f0638c88162351318b7bc8b64c5f2fba7/xtask/codegen/src/generate_global_types/lower.rs#L838-L874","documentation":"The Promise value declaration (`declare var Promise: PromiseConstructor`) references the PromiseConstructor type, so lowering requires a corresponding 'PromiseConstructor' global group. When the manifest has no such group, the reference cannot be resolved and codegen fails with this message.","triggerScenarios":"Running `cargo xtask codegen` when manifest.global_group(\"PromiseConstructor\") returns None — the PromiseConstructor declarations are absent from the manifest, were renamed, or were not grouped under that name.","commonSituations":"Removing or renaming the `interface PromiseConstructor` block in the global typings; a grouping/parsing change stops associating PromiseConstructor declarations with that group name; partially copied global declaration files.","solutions":["Add or restore the PromiseConstructor declarations (the `interface PromiseConstructor` with construct signature, then, catch, finally) to the global typings source.","Confirm the group name is exactly \"PromiseConstructor\" in the manifest and grouping logic.","Regenerate and re-run `cargo xtask codegen`."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Verify the referenced group exists before lowering\nfn group_exists(manifest: &Manifest, name: &str) -> bool {\n  manifest.global_group(name).is_some()\n}\nif !group_exists(&manifest, \"PromiseConstructor\") {\n  bail!(\"Promise value side references missing PromiseConstructor group\");\n}","typeGuard":null,"tryCatchPattern":"match lower_promise_globals(&manifest, &mut globals, &source_cache) {\n  Err(e) if e.to_string().contains(\"missing PromiseConstructor group\") => {\n    eprintln!(\"Restore the `interface PromiseConstructor` declarations and rerun `cargo xtask codegen`\");\n    std::process::exit(1);\n  }\n  r => r?,\n}","preventionTips":["Keep PromiseConstructor declarations in the same globals source as Promise.","Never rename the \"PromiseConstructor\" group key without updating lowering code.","Add a test asserting global_group(\"PromiseConstructor\") resolves after manifest build.","Diff generated manifests when refactoring grouping logic."],"tags":["codegen","rust","build","typescript-globals"],"backgroundTag":"resource-not-found","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"}