diff --git a/src/wasm-lib/kcl/src/execution/mod.rs b/src/wasm-lib/kcl/src/execution/mod.rs index 223d9de66..6ff5b1926 100644 --- a/src/wasm-lib/kcl/src/execution/mod.rs +++ b/src/wasm-lib/kcl/src/execution/mod.rs @@ -2642,15 +2642,20 @@ impl ExecutorContext { let (result, _, _) = self .exec_module(module_id, exec_state, ExecutionKind::Normal, metadata.source_range) .await?; - result.ok_or_else(|| { - KclError::Semantic(KclErrorDetails { - message: format!( - "Evaluating module `{}` as part of an assembly did not produce a result", - identifier.name - ), - source_ranges: vec![metadata.source_range, meta[0].source_range], - }) - })? + result.unwrap_or_else(|| { + // The module didn't have a return value. Currently, + // the only way to have a return value is with the final + // statement being an expression statement. + // + // TODO: Make a warning when we support them in the + // execution phase. + let mut new_meta = vec![metadata.to_owned()]; + new_meta.extend(meta); + KclValue::KclNone { + value: Default::default(), + meta: new_meta, + } + }) } else { value }