facebook/flow · error
invalid column
Error message
invalid column
What it means
In the autocomplete command's two-argument form [line, column] (no filename, content from stdin), the column argument is parsed with column.parse().expect("invalid column"). A value that is not a valid i32 (letters, empty, out of range) panics with "invalid column" rather than producing a usage error.
Source
Thrown at rust_port/crates/flow_cli/src/autocomplete_command.rs:105
command_utils::get_file_from_filename_or_stdin(spec().name.as_str(), filename, None)
}
fn parse_args(
args: Option<Vec<String>>,
) -> (flow_server_utils::file_input::FileInput, Option<(i32, i32)>) {
match args.as_deref() {
None | Some([]) => {
let input = file_input_from_stdin(None);
extract_cursor(input)
}
Some([filename]) => {
let input = file_input_from_stdin(Some(filename.as_str()));
extract_cursor(input)
}
Some([line, column]) => {
let cursor = command_utils::convert_input_pos(
line.parse().expect("invalid line"),
column.parse().expect("invalid column"),
);
let input = file_input_from_stdin(None);
(input, Some(cursor))
}
Some([filename, line, column]) => {
let cursor = command_utils::convert_input_pos(
line.parse().expect("invalid line"),
column.parse().expect("invalid column"),
);
let input = file_input_from_stdin(Some(filename.as_str()));
(input, Some(cursor))
}
_ => {
eprintln!(
"{}",
command_spec::command(spec(), |_| {}).string_of_usage()
);
flow_common_exit_status::exit(View on GitHub (pinned to f88ac94bcf)
Solutions
- Pass a plain 1-based integer for column: flow autocomplete 12 5.
- Validate that both values are integers before shelling out from integrations or scripts.
- Check the usage output (run with no args) for the accepted forms.
Example fix
# before: second argument is not an i32 flow autocomplete 12 5.5 # panics: invalid column # after flow autocomplete 12 5
Defensive patterns
Strategy: validation
Validate before calling
# Reject non-integer column values before invoking autocomplete. case "$2" in ''|*[!0-9-]*) echo "column must be an integer"; exit 2;; esac
Prevention
- Send plain integers from integrations — no decorations, offsets, or formatted positions.
- Default optional/empty variables to a valid integer or omit the position entirely.
- Smoke-test CLI wrappers with edge-case arguments before shipping.
When it happens
Trigger: Calling autocomplete with two positional args where the second is not an integer: flow autocomplete 12 5.5, flow autocomplete 12 col, or an empty string from an unset script variable.
Common situations: Editor integrations sending a 0-based/offset or formatted position instead of a plain integer; scripts interpolating unquoted/empty variables; argument-order mixups placing a flag in the column slot.
Related errors
- invalid line
- failed to read stdin
- failed to get current directory
- failed to write json errors
- failed to flush json errors
AI-assisted analysis of facebook/flow@f88ac94bcf (2026-08-20).
Data as JSON: /api/errors/b86fb7e1685a1d6c.
Report an issue: GitHub.