DioxusLabs/dioxus · error

Failed to convert wasm bindgen output path to string

Error message

Failed to convert wasm bindgen output path to string

What it means

`AppManifest::register_asset` requires the asset path to be valid UTF-8 to embed it in the manifest; it returns this error when the path contains invalid Unicode (possible on some filesystems). The asset path at fault is the `asset_path` argument that `Path::to_str` rejected.

Solutions

  1. The wasm-bindgen output path is not valid UTF-8. Use a UTF-8 output path.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/cli/src/opt/mod.rs:52 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/ea50de1f22c1ca3c. Report an issue: GitHub.

Appendix: source

Thrown at packages/cli/src/opt/mod.rs:52

}

impl AppManifest {
    pub fn new() -> Self {
        Self {
            cli_version: crate::VERSION.to_string(),
            android_artifacts: Default::default(),
            swift_sources: Default::default(),
            assets: Default::default(),
        }
    }

    /// Manually add an asset to the manifest
    pub fn register_asset(
        &mut self,
        asset_path: &Path,
        options: manganis::AssetOptions,
    ) -> anyhow::Result<BundledAsset> {
        let output_path_str = asset_path.to_str().ok_or(anyhow::anyhow!(
            "Failed to convert wasm bindgen output path to string"
        ))?;

        let mut bundled_asset =
            manganis::macro_helpers::create_bundled_asset(output_path_str, options);
        add_hash_to_asset(&mut bundled_asset);

        self.assets
            .entry(asset_path.to_path_buf())
            .or_default()
            .insert(bundled_asset);

        Ok(bundled_asset)
    }

    /// Insert an existing bundled asset to the manifest
    pub fn insert_asset(&mut self, asset: BundledAsset) {
        let asset_path = asset.absolute_source_path();

View on GitHub (pinned to 24f6a829df)