diff --git a/crates/nu-parser/src/parse_keywords.rs b/crates/nu-parser/src/parse_keywords.rs index e7bcb38a3b..9120ac6cc8 100644 --- a/crates/nu-parser/src/parse_keywords.rs +++ b/crates/nu-parser/src/parse_keywords.rs @@ -287,7 +287,10 @@ pub fn parse_module( } _ => ( garbage_statement(&pipeline.commands[0].parts), - Some(ParseError::Expected("def".into(), block_span)), + Some(ParseError::Expected( + "def".into(), + pipeline.commands[0].parts[0], + )), ), };