{"record":{"id":"1a8e241771c29a23","repo":"BoundaryML/baml","slug":"function-not-found-name","errorCode":null,"errorMessage":"Function not found: {name}","messagePattern":"Function not found: (.+?)","errorType":"exception","errorClass":"EngineError","httpStatus":null,"severity":"error","filePath":"baml_language/crates/bex_engine/src/lib.rs","lineNumber":807,"sourceCode":"        if no_active_calls {\n            self.engine.lifecycle_changed.notify_waiters();\n        }\n    }\n}\n\n/// Errors that can occur during engine execution.\n#[derive(Debug, PartialEq, Error, Clone)]\npub enum EngineError {\n    #[error(\"BAML engine is shutting down\")]\n    ShuttingDown,\n\n    #[error(\"Function call with ID {call_id} not found\")]\n    FunctionCallNotFound { call_id: CallId },\n\n    #[error(\"Future with ID {future_id} not found\")]\n    FutureNotFound { future_id: FutureId },\n\n    #[error(\"Function not found: {name}\")]\n    FunctionNotFound { name: String },\n\n    /// Function exists, but its `FunctionKind` is not invokable as an\n    /// engine entry point. Only bytecode functions can be called via\n    /// [`BexEngine::call_function`] / [`BexEngine::call_function_bound_args`]:\n    /// native (`$rust_function`) entries would re-enter the VM through\n    /// `YieldToCall` with no bytecode frame to return to. Sysops + builtins\n    /// reach their natives from inside a calling bytecode body.\n    #[error(\"Function `{name}` is not invokable as an entry point (kind: {kind})\")]\n    NotInvokableAsEntry { name: String, kind: String },\n\n    #[error(\"VM internal error: {0}\")]\n    VmInternalError(bex_vm::errors::VmInternalError),\n\n    #[error(\"{}\", format_vm_internal_error(source, trace))]\n    TracedVmInternalError {\n        source: bex_vm::errors::VmInternalError,\n        trace: Vec<bex_vm::StackFrame>,","sourceCodeStart":789,"sourceCodeEnd":825,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/bex_engine/src/lib.rs#L789-L825","documentation":"`EngineError::FunctionNotFound` is raised when a function name does not exist in the engine's function table. The name is resolved before any invocation is attempted; unknown names are rejected outright.","triggerScenarios":"Calling `BexEngine::call_function` / `call_function_bound_args` with a name string that matches no registered function.","commonSituations":"Typo in the function name; calling a function defined in a BAML file that was not loaded/compiled into this engine; renaming a function in source without updating call sites.","solutions":["Verify the exact function name against the loaded BAML sources.","Ensure the module/program defining the function was compiled and registered into this engine.","Fix typos and re-run after any rename."],"exampleFix":"// before\nengine.call_function(\"ClassfyDoc\", args).await?;\n// after\nengine.call_function(\"ClassifyDocument\", args).await?;","handlingStrategy":"try-catch","validationCode":"// rust\nif !engine.has_function(name) { /* resolve before calling */ }","typeGuard":null,"tryCatchPattern":"// rust\nmatch engine.call_function(name, args).await {\n    Err(EngineError::FunctionNotFound { name }) => eprintln!(\"unknown function: {name}\"),\n    other => other?,\n}","preventionTips":["Source function names from compile-time constants, not free-form strings","Verify the defining BAML file is loaded into the engine","Re-check names after any refactor/rename"],"tags":["engine","lookup","naming","rust"],"backgroundTag":"entity-not-found","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}