{"record":{"id":"cb495e5626943191","repo":"BoundaryML/baml","slug":"function-not-found-name-error","errorCode":null,"errorMessage":"Function not found: {name}","messagePattern":"Function not found: (.+?)","errorType":"exception","errorClass":"BridgeError","httpStatus":null,"severity":"error","filePath":"baml_language/crates/bridge_cffi/src/error.rs","lineNumber":28,"sourceCode":"    #[error(\"Engine not initialized. Call create_baml_runtime first.\")]\n    NotInitialized,\n\n    #[error(\"Project not initialized\")]\n    ProjectNotInitialized,\n\n    #[error(\"Engine lock poisoned\")]\n    LockPoisoned,\n\n    #[error(\"{0}\")]\n    Runtime(#[from] bex_project::RuntimeError),\n\n    #[error(\"CallFunctionArgs.call_target must be set\")]\n    MissingCallTarget,\n\n    #[error(\"type arguments are not supported when invoking a BAML function handle\")]\n    FunctionHandleTypeArgs,\n\n    #[error(\"Function not found: {name}\")]\n    FunctionNotFound { name: String },\n\n    #[error(\"Missing argument '{parameter}' for function '{function}'\")]\n    MissingArgument { function: String, parameter: String },\n\n    #[error(\"Not implemented: {0}\")]\n    NotImplemented(String),\n\n    #[error(\"call_id {0} is already in use by an active call\")]\n    DuplicateCallId(u64),\n\n    #[error(\"call_id must be a nonzero uint64\")]\n    InvalidCallId,\n\n    #[error(\"Internal error: {0}\")]\n    Internal(String),\n\n    #[error(\"{0}\")]","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/bridge_cffi/src/error.rs#L10-L46","documentation":"BridgeError::FunctionNotFound carries the missing function's name. The bridge looked up call_target in the loaded BAML runtime's function registry and found no matching function. This means the name does not exist in the compiled BAML project the engine was initialized with.","triggerScenarios":"Calling call_function with a call_target name that is not defined in the loaded BAML project; typo'd function names; calling a function defined only in a different project version.","commonSituations":"Typo or casing mismatch between client and .baml file; renaming a BAML function without updating callers; runtime initialized from a stale build that predates the new function.","solutions":["Verify the exact function name (including case) matches a function declared in your .baml files.","Rebuild/re-initialize the runtime so it includes the latest .baml definitions.","List available functions from the runtime (if exposed) to check spelling.","Ensure the correct project directory was passed to create_baml_runtime."],"exampleFix":"// before\nargs.call_target = \"ExtractResum\";\n// after\nargs.call_target = \"ExtractResume\"; // matches `function ExtractResume(...)`,","handlingStrategy":"validation","validationCode":"known = {'ExtractResume', 'ClassifyDoc'}  # keep in sync with .baml files\nif args.call_target not in known:\n    raise ValueError(f'unknown BAML function: {args.call_target}')","typeGuard":null,"tryCatchPattern":"try:\n    bridge.call_function(args)\nexcept BridgeError as e:\n    if e is BridgeError.FunctionNotFound:\n        log.error(f'Function {e.name} not in project; check .baml files and rebuild')","preventionTips":["Keep client function-name constants in sync with .baml files","Rebuild/re-init the runtime after editing .baml files","Match exact casing of function declarations"],"tags":["ffi","lookup","naming"],"backgroundTag":"resource-not-found","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"}