{"record":{"id":"d1f16669ba390708","repo":"BoundaryML/baml","slug":"compile-produced-no-assembled-units","errorCode":null,"errorMessage":"compile produced no assembled units","messagePattern":"compile produced no assembled units","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_cli/src/bytecode_cache.rs","lineNumber":1573,"sourceCode":"    ///\n    /// `compiled` must carry assembled units: every cached compile assembles\n    /// them alongside the program, so a store without them is a programmer\n    /// error, reported the way every store failure is (the compile itself\n    /// succeeded; release builds degrade to an uncached run).\n    pub(crate) fn store_artifacts_with_manifest(\n        &self,\n        db: &ProjectDatabase,\n        package: SourceRoot,\n        compiled: &CompiledArtifacts,\n        fresh_by_file: &std::collections::BTreeMap<String, Vec<u8>>,\n        plan: Option<&ReusePlan>,\n    ) -> std::io::Result<CacheStoreStats> {\n        let (units, reused_units): (&[CompilationUnit], bool) = match &compiled.units {\n            CompiledUnits::Fresh(units) => (units, false),\n            CompiledUnits::Reused(units) => (units, true),\n            CompiledUnits::None => {\n                debug_assert!(false, \"cached compile stored without assembled units\");\n                return Err(std::io::Error::new(\n                    std::io::ErrorKind::InvalidData,\n                    \"compile produced no assembled units\",\n                ));\n            }\n        };\n        self.store(&compiled.program)?;\n\n        let mut units_by_source = HashMap::with_capacity(units.len());\n        for unit in units {\n            if units_by_source\n                .insert(unit.source_file.as_str(), unit)\n                .is_some()\n            {\n                return Err(std::io::Error::new(\n                    std::io::ErrorKind::InvalidData,\n                    format!(\"duplicate compilation unit for `{}`\", unit.source_file),\n                ));\n            }","sourceCodeStart":1555,"sourceCodeEnd":1591,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_cli/src/bytecode_cache.rs#L1555-L1591","documentation":"Internal invariant failure while writing compiled artifacts to the bytecode cache: store_artifacts_with_manifest was called with a CompiledArtifacts whose assembled-units list is empty. Every cached compile assembles units alongside the program, so an empty list means the caller passed an incomplete artifact bundle — a programmer error inside the CLI, not a user-input problem. The store is aborted and reported like any cache store failure.","triggerScenarios":"Thrown at baml_language/crates/baml_cli/src/bytecode_cache.rs:1573 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Update baml — this is a bug in the CLI's cache-store path, not in project sources","As a workaround, disable the bytecode cache (BAML_NO_CACHE or equivalent) so the uncached compile path runs","Report the issue to the BAML maintainers with the command that triggered it"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}