{"record":{"id":"b4376c01f84d1357","repo":"BoundaryML/baml","slug":"e-message","errorCode":null,"errorMessage":"{e.message()}","messagePattern":"\\{e\\.message\\(\\)\\}","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"engine/baml-lib/baml-core/src/ir/repr.rs","lineNumber":2772,"sourceCode":"                .iter()\n                .map(|arg| {\n                    let field_type = arg.1.field_type.repr(db)?;\n                    Ok((arg.0.to_string(), field_type))\n                })\n                .collect::<Result<Vec<_>>>()?,\n            output: self\n                .ast_function()\n                .output()\n                .expect(\"need block arg\")\n                .field_type\n                .repr(db)?,\n            configs: vec![FunctionConfig {\n                name: \"default_config\".to_string(),\n                prompt_template: self.jinja_prompt().to_string(),\n                prompt_span: self.ast_function().span().clone(),\n                client: match self.client_spec() {\n                    Ok(spec) => spec,\n                    Err(e) => anyhow::bail!(\"{}\", e.message()),\n                },\n            }],\n            default_config: \"default_config\".to_string(),\n            tests: self\n                .walk_tests()\n                .map(|e| e.node(db))\n                .collect::<Result<Vec<_>>>()?,\n        })\n    }\n}\n\ntype ClientId = String;\n\n#[derive(Debug)]\npub struct Client {\n    pub name: ClientId,\n    pub provider: ClientProvider,\n    pub retry_policy_id: Option<String>,","sourceCodeStart":2754,"sourceCodeEnd":2790,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-lib/baml-core/src/ir/repr.rs#L2754-L2790","documentation":"This error is raised while building the IR FunctionConfig for a BAML function: the function's client_spec() could not be resolved, so the compiler bails out with the resolver's error message. It means the function's declared client (or its shorthand provider form) failed to resolve into a concrete client configuration.","triggerScenarios":"Calling IR functions that walk configs when the function references a client that does not exist in the baml_src clients block, or whose provider/target arguments are invalid, so client_spec() returns Err.","commonSituations":"Typo in the client name referenced by a function, a missing 'clients' block, renaming a client without updating functions, or using a shorthand client spec with an unsupported provider.","solutions":["Check that the client name used by the function matches an entry in the clients { } block in your .baml files","Run baml-cli (or your editor's BAML LSP) validate to see the underlying resolver error message which is embedded in this error","If using a shorthand client (e.g. provider string directly), verify the provider is supported and required args are present","Restore or re-add any deleted client definitions that functions still reference"],"exampleFix":"// before\nfunction ExtractResume(text: string) {\n  client myClint // typo\n  prompt #\"...\"#\n}\n// after\nfunction ExtractResume(text: string) {\n  client MyClient // matches a defined client\n  prompt #\"...\"#\n}","handlingStrategy":"validation","validationCode":"// Check the function references a defined client before compile/generation\nlet defined_clients: HashSet<&str> = baml_src.clients.iter().map(|c| c.name.as_str()).collect();\nif !defined_clients.contains(fn_config.client.as_str()) {\n    bail!(\"function {} references unknown client {}\", fn_config.name, fn_config.client);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a single clients block and reference clients only from it","Run baml validation in CI to catch client resolution errors before runtime","Use the BAML LSP/editor extension for live diagnostics"],"tags":["baml","compile-time","client-resolution","config"],"backgroundTag":"missing-config-value","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}