{"record":{"id":"35f9f44b94af67ab","repo":"DioxusLabs/dioxus","slug":"no-input-file-source-or-stdin-to-translate-from","errorCode":null,"errorMessage":"No input file, source, or stdin to translate from.","messagePattern":"No input file, source, or stdin to translate from\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/cli/translate.rs","lineNumber":125,"sourceCode":"fn determine_input(file: Option<String>, raw: Option<String>) -> Result<String> {\n    use std::io::IsTerminal as _;\n\n    // Make sure not both are specified\n    if file.is_some() && raw.is_some() {\n        bail!(\"Only one of --file or --raw should be specified.\");\n    }\n\n    if let Some(raw) = raw {\n        return Ok(raw);\n    }\n\n    if let Some(file) = file {\n        return Ok(std::fs::read_to_string(file)?);\n    }\n\n    // If neither exist, we try to read from stdin\n    if std::io::stdin().is_terminal() {\n        bail!(\"No input file, source, or stdin to translate from.\");\n    }\n\n    let mut buffer = String::new();\n    std::io::stdin().read_to_string(&mut buffer).unwrap();\n\n    Ok(buffer.trim().to_string())\n}\n","sourceCodeStart":107,"sourceCodeEnd":133,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/cli/translate.rs#L107-L133","documentation":"Input guard in determine_input (called from translate): neither `--raw` nor `--file` was provided, and stdin is attached to a terminal rather than a pipe, so there is no source text to translate. The input at fault is the empty combination of all three input channels (raw source, file path, piped stdin).","triggerScenarios":"Thrown at packages/cli/src/cli/translate.rs:125 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide input to dx translate via --file, --raw, or stdin."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}