diff --git a/crates/nu-cli/src/commands/to_json.rs b/crates/nu-cli/src/commands/to_json.rs index be2373ab4..702feda3f 100644 --- a/crates/nu-cli/src/commands/to_json.rs +++ b/crates/nu-cli/src/commands/to_json.rs @@ -240,7 +240,7 @@ async fn to_json( ReturnSuccess::value( UntaggedValue::Primitive(Primitive::String(serde_json_string)) - .into_value(&name_tag), + .into_value(&value.tag), ) } _ => Err(ShellError::labeled_error_with_secondary(