{"record":{"id":"ea50de1f22c1ca3c","repo":"DioxusLabs/dioxus","slug":"failed-to-convert-wasm-bindgen-output-path-to-stri","errorCode":null,"errorMessage":"Failed to convert wasm bindgen output path to string","messagePattern":"Failed to convert wasm bindgen output path to string","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/opt/mod.rs","lineNumber":52,"sourceCode":"}\n\nimpl AppManifest {\n    pub fn new() -> Self {\n        Self {\n            cli_version: crate::VERSION.to_string(),\n            android_artifacts: Default::default(),\n            swift_sources: Default::default(),\n            assets: Default::default(),\n        }\n    }\n\n    /// Manually add an asset to the manifest\n    pub fn register_asset(\n        &mut self,\n        asset_path: &Path,\n        options: manganis::AssetOptions,\n    ) -> anyhow::Result<BundledAsset> {\n        let output_path_str = asset_path.to_str().ok_or(anyhow::anyhow!(\n            \"Failed to convert wasm bindgen output path to string\"\n        ))?;\n\n        let mut bundled_asset =\n            manganis::macro_helpers::create_bundled_asset(output_path_str, options);\n        add_hash_to_asset(&mut bundled_asset);\n\n        self.assets\n            .entry(asset_path.to_path_buf())\n            .or_default()\n            .insert(bundled_asset);\n\n        Ok(bundled_asset)\n    }\n\n    /// Insert an existing bundled asset to the manifest\n    pub fn insert_asset(&mut self, asset: BundledAsset) {\n        let asset_path = asset.absolute_source_path();","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/393d190a801ccb441d41923e232289b4f8a5c669/packages/cli/src/opt/mod.rs#L34-L70","documentation":"register_asset converts the asset path to a &str before handing it to manganis' create_bundled_asset; paths containing non-UTF-8 bytes fail Path::to_str() and bail with this (historically worded) message about the wasm-bindgen output path, since the same code path handles wasm-bindgen artifacts. No asset processing is attempted.","triggerScenarios":"An asset or wasm-bindgen output whose absolute path contains non-UTF-8 bytes — typically a username or directory created under a non-UTF-8 locale on Linux/macOS — registered during a dx build.","commonSituations":"Building in a home directory with legacy-encoding characters; project paths copied from other systems with mis-decoded components; CI runners provisioned with odd locale settings.","solutions":["Move or clone the project so every path component is valid UTF-8 (ASCII is safest)","Rename the offending directory, or set a UTF-8 locale for the build environment","Check with: cargo metadata style inspection or 'ls | iconv -f utf-8 -t utf-8' to find undecodable components"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Assert early in build scripts\nfn assert_utf8_paths(paths: &[std::path::PathBuf]) {\n    for p in paths {\n        assert!(p.to_str().is_some(), \"non-UTF-8 path component in {p:?}\");\n    }\n}","typeGuard":"fn is_utf8_path(p: &std::path::Path) -> bool { p.to_str().is_some() }","tryCatchPattern":null,"preventionTips":["Keep project roots and user names in pure ASCII/UTF-8","Set a UTF-8 locale in CI images","Check out repositories into paths without locale-specific encodings"],"tags":["cli","assets","wasm-bindgen","utf-8","path"],"backgroundTag":null,"analyzedSha":"393d190a801ccb441d41923e232289b4f8a5c669","analyzedAt":"2026-08-16T11:27:45.815Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}