DioxusLabs/dioxus · error

Could not find export

Error message

Could not find export

What it means

wasm splitting pairs every synthetic import named __wasm_split_00___<mod>___00_import_<hash>_<fn> with an equally-named export (..._export_...) emitted by the dioxus toolchain. While collecting split points, exports.get_func on the paired name fails and panics when that export is absent from the module.

Source

Thrown at packages/wasm-split/wasm-split-cli/src/lib.rs:1412

                return None;
            }

            let ImportKind::Function(import_func) = import.kind else {
                return None;
            };

            // Parse the import name to get the module name, the hash, and the function name
            let remain = import.name.trim_start_matches("__wasm_split_00___");
            let (module_name, rest) = remain.split_once("___00").unwrap();
            let (hash, fn_name) = rest.trim_start_matches("_import_").split_once("_").unwrap();

            // Look for the export with the same name
            let export_name =
                format!("__wasm_split_00___{module_name}___00_export_{hash}_{fn_name}");
            let export_func = module
                .exports
                .get_func(&export_name)
                .expect("Could not find export");
            let export = module.exports.get_exported_func(export_func).unwrap();

            let our_index = index;
            index += 1;

            Some(SplitPoint {
                export_id: export.id(),
                import_id: import.id(),
                module_name: module_name.to_string(),
                import_name: import.name.clone(),
                import_func,
                export_func,
                export_name,
                hash_name: hash.to_string(),
                component_name: fn_name.to_string(),
                index: our_index,
                reachable_graph: Default::default(),
            })

View on GitHub (pinned to 393d190a80)

Solutions

  1. Regenerate both inputs in one clean build (cargo clean) and re-run the split
  2. Verify you pass the rustc-emitted module and the wasm-bindgen output from the same target directory and build
  3. Align dx, wasm-bindgen and dioxus versions; prefer running via dx so the correct inputs are chosen
Defensive patterns

Strategy: validation

Validate before calling

// Before splitting, sanity-check the pairing exists (CLI wrapper):
fn split_points_paired(module: &wasm_encoder_module_repr) -> bool {
    // for every import __wasm_split_00___*___00_import_*
    // assert an export __wasm_split_00___<mod>___00_export_<hash>_<fn> exists
    imports_starting_with("__wasm_split_00___")
        .all(|imp| exports_contain(&paired_export_name(&imp)))
}

Prevention

When it happens

Trigger: Passing mismatched inputs to the splitter — an original (rustc-emitted) module and a bindgened module from different builds — or a wasm-bindgen/toolchain version that renames or strips the synthetic split-point exports.

Common situations: Stale build artifacts: invoking wasm-split-cli split with leftover files from a previous build; partial rebuilds after an upgrade; wrong argument order (bindgened vs original swapped).

Related errors


AI-assisted analysis of DioxusLabs/dioxus@393d190a80 (2026-08-16). Data as JSON: /api/errors/82a1e7a631089833. Report an issue: GitHub.