DioxusLabs/dioxus · error
input_path should be valid utf8
Error message
input_path should be valid utf8
What it means
`WasmBindgenToBuildRequest::run` converts the wasm-bindgen out_dir to a string for the `--out-dir` argument and `expect`s valid UTF-8. This panic fires when the output directory path contains non-UTF-8 characters, which the CLI argument encoding cannot represent.
Solutions
- Use a build/output path that is valid UTF-8; rename directories containing non-UTF-8 bytes in the wasm-bindgen input path.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/cli/src/wasm_bindgen.rs:147 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23).
Data as JSON: /api/errors/ae9cb002ca1750db.
Report an issue: GitHub.
Appendix: source
Thrown at packages/cli/src/wasm_bindgen.rs:147
args.push("--remove-producers-section");
}
if self.keep_lld_exports {
args.push("--keep-lld-exports");
}
// Out name
args.push("--out-name");
args.push(&self.out_name);
// wbg generates typescript bindnings by default - we don't want those
args.push("--no-typescript");
// Out dir
let out_dir = self
.out_dir
.to_str()
.expect("input_path should be valid utf8");
args.push("--out-dir");
args.push(out_dir);
// Input path
let input_path = self
.input_path
.to_str()
.expect("input_path should be valid utf8");
args.push(input_path);
tracing::debug!("wasm-bindgen: {:#?}", args);
// Run bindgen
let output = Command::new(binary).args(args).output().await?;
// Check for errors
if !output.stderr.is_empty() {View on GitHub (pinned to 24f6a829df)