{"record":{"id":"c93db23595836569","repo":"BoundaryML/baml","slug":"type-0-is-not-supported-in-outputs","errorCode":null,"errorMessage":"Type '{0}' is not supported in outputs","messagePattern":"Type '(.+?)' is not supported in outputs","errorType":"exception","errorClass":"RenderError","httpStatus":null,"severity":"error","filePath":"baml_language/crates/sys_ops/src/output_format.rs","lineNumber":15,"sourceCode":"use std::fmt::Write as _;\n\nuse ::sys_types::SapTy;\nuse baml_base::Literal as LiteralValue;\nuse indexmap::IndexMap;\nuse thiserror::Error;\n\n/// Error type for output format rendering.\n#[derive(Clone, Debug, Error)]\npub enum RenderError {\n    #[error(\"Enum '{0}' not found\")]\n    EnumNotFound(String),\n    #[error(\"Class '{0}' not found\")]\n    ClassNotFound(String),\n    #[error(\"Type '{0}' is not supported in outputs\")]\n    UnsupportedType(String),\n    #[error(\n        \"Non-regular recursive generic class '{class}' expands from '{ancestor}' to '{instantiation}'\"\n    )]\n    NonRegularRecursiveGeneric {\n        class: String,\n        ancestor: String,\n        instantiation: String,\n    },\n    #[error(\n        \"Output definitions '{first}' and '{second}' both render as '{rendered_name}' in the output schema\"\n    )]\n    RenderedClassNameCollision {\n        rendered_name: String,\n        first: String,\n        second: String,\n    },\n    #[error(","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/sys_ops/src/output_format.rs#L1-L33","documentation":"RenderError::UnsupportedType is raised when the output_format renderer encounters a type it cannot represent in rendered outputs. The '{0}' placeholder is the type's display string. The renderer supports a fixed set of output types; anything else (e.g. certain generics, images, or internal-only types) is rejected with this error.","triggerScenarios":"Declaring an output schema field whose type is outside the renderer's supported set, or piping runtime values of unsupported types into output rendering.","commonSituations":"Using exotic BAML types (unsupported generics, media/internal types) as class fields for output, or newer type kinds rendered by an older renderer version that predates support.","solutions":["Change the output schema field to a supported type (primitive, supported class/enum, list/map)","Upgrade the library if the type should be supported in a newer version","Strip or transform unsupported fields before rendering","Check release notes for the supported output type matrix"],"exampleFix":"// before\nclass Result { image Image }\n// after\nclass Result { image_url string }","handlingStrategy":"validation","validationCode":"const SUPPORTED = new Set(['string','int','float','bool','list','map','class','enum']);\nfunction allFieldsSupported(schema) {\n  return schema.fields.every(f => SUPPORTED.has(f.type.kind));\n}\n// call before render: allFieldsSupported(outputSchema)","typeGuard":"function isUnsupportedTypeError(e) {\n  return e instanceof Error && /Type '.*' is not supported in outputs/.test(e.message);\n}","tryCatchPattern":"try {\n  rendered = render(value, registry);\n} catch (e) {\n  if (isUnsupportedTypeError(e)) {\n    rendered = stripUnsupported(value); // drop/serialize unrepresentable fields\n  } else throw e;\n}","preventionTips":["Keep output schemas within the renderer's supported type matrix","Upgrade the library before using newly introduced type kinds in outputs","Transform media/internal types to string representations pre-render","Add schema linting that rejects unsupported output field kinds"],"tags":["rendering","schema","unsupported-type"],"backgroundTag":"unsupported-operation","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}