{"record":{"id":"e828bc2cf6e57e38","repo":"BoundaryML/baml","slug":"unkown-function","errorCode":null,"errorMessage":"unkown function: {}","messagePattern":"unkown function: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-runtime/src/async_vm_runtime.rs","lineNumber":525,"sourceCode":"                            //\n                            // The only difference is that the returned task JoinHandle\n                            // is itself !Send, which means it can't be awaited from\n                            // other threads.\n                            //\n                            // But it does not matter because in WASM we're not gonna\n                            // await the task from another thread, wasm-bindgen-futures\n                            // basically turns Rust futures into JavaScript promises,\n                            // which are supposed to be single threaded. So, on WASM,\n                            // except for compilation required types, spawn and\n                            // spawn_local are essentially equivalent.\n                            #[cfg(target_arch = \"wasm32\")]\n                            wasm_bindgen_futures::spawn_local(future);\n                        }\n\n                        baml_vm::FutureKind::Net => {\n                            // Only `baml.fetch_as` is supported for now.\n                            if pending_future.function != \"baml.fetch_as\" {\n                                break 'mainloop Err(anyhow!(\n                                    \"unkown function: {}\",\n                                    pending_future.function\n                                ));\n                            }\n\n                            if pending_future.args.len() != 2 {\n                                break 'mainloop Err(anyhow!(\n                                    \"expected 2 arguments for `baml.fetch_as`, got {}\",\n                                    pending_future.args.len()\n                                ));\n                            }\n\n                            let url_or_request =\n                                match try_baml_value_from_vm_value(&vm, &pending_future.args[0]) {\n                                    Ok(url_or_request) => url_or_request,\n                                    Err(e) => {\n                                        break 'mainloop Err(e.context(\n                                        \"baml.fetch_as: failed to get url or request from VM value\",","sourceCodeStart":507,"sourceCodeEnd":543,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-runtime/src/async_vm_runtime.rs#L507-L543","documentation":"BAML's VM only supports `baml.fetch_as` for network futures, but a Net-kind future was scheduled with a different function name. The runtime intentionally rejects it instead of dispatching to an unimplemented builtin. The message is a misspelling of 'unknown function: <name>'.","triggerScenarios":"Calling any network builtin other than baml.fetch_as (e.g. baml.fetch, http.get) inside BAML code executed via the async VM, so a FutureKind::Net future resolves to an unsupported function name.","commonSituations":"Using an older or newer BAML dialect that exposes other net functions, typo-ing `baml.fetch_as` (e.g. `baml.fetch`), or porting BAML snippets that rely on features not implemented in this runtime version.","solutions":["Rename the call to `baml.fetch_as` in the BAML code, which is the only supported network function","Check the installed BAML runtime version's supported builtins and upgrade if `baml.fetch_as` alternatives were added later","Fix typos in the function name inside the .baml source","If a custom builtin was intended, remove or gate the call behind a feature the VM implements"],"exampleFix":"// before (BAML)\nlet raw = baml.fetch(\"https://api.example.com/data\")\n// after\nlet raw = baml.fetch_as(\"https://api.example.com/data\", MyType)","handlingStrategy":"validation","validationCode":"// before executing BAML code, scan its source for unsupported net builtins\nfunction validateNetFunctions(bamlSrc) {\n  const calls = [...bamlSrc.matchAll(/baml\\.(\\w+)\\s*\\(/g)].map(m => m[1]);\n  const bad = calls.filter(n => n !== 'fetch_as');\n  if (bad.length) throw new Error(`Unsupported baml.* functions: ${[...new Set(bad)].join(', ')}. Only baml.fetch_as is supported.`);\n}","typeGuard":"function isSupportedNetCall(name) { return name === 'baml.fetch_as'; }","tryCatchPattern":null,"preventionTips":["Only use baml.fetch_as for network access in BAML code","Keep a lint/regex check on .baml sources for baml.* calls before deploying"],"tags":["baml","wasm","vm","unsupported-function"],"backgroundTag":"unsupported-operation","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"}