{"record":{"id":"82a1e7a631089833","repo":"DioxusLabs/dioxus","slug":"could-not-find-export","errorCode":null,"errorMessage":"Could not find export","messagePattern":"Could not find export","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/wasm-split/wasm-split-cli/src/lib.rs","lineNumber":1412,"sourceCode":"                return None;\n            }\n\n            let ImportKind::Function(import_func) = import.kind else {\n                return None;\n            };\n\n            // Parse the import name to get the module name, the hash, and the function name\n            let remain = import.name.trim_start_matches(\"__wasm_split_00___\");\n            let (module_name, rest) = remain.split_once(\"___00\").unwrap();\n            let (hash, fn_name) = rest.trim_start_matches(\"_import_\").split_once(\"_\").unwrap();\n\n            // Look for the export with the same name\n            let export_name =\n                format!(\"__wasm_split_00___{module_name}___00_export_{hash}_{fn_name}\");\n            let export_func = module\n                .exports\n                .get_func(&export_name)\n                .expect(\"Could not find export\");\n            let export = module.exports.get_exported_func(export_func).unwrap();\n\n            let our_index = index;\n            index += 1;\n\n            Some(SplitPoint {\n                export_id: export.id(),\n                import_id: import.id(),\n                module_name: module_name.to_string(),\n                import_name: import.name.clone(),\n                import_func,\n                export_func,\n                export_name,\n                hash_name: hash.to_string(),\n                component_name: fn_name.to_string(),\n                index: our_index,\n                reachable_graph: Default::default(),\n            })","sourceCodeStart":1394,"sourceCodeEnd":1430,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/393d190a801ccb441d41923e232289b4f8a5c669/packages/wasm-split/wasm-split-cli/src/lib.rs#L1394-L1430","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Regenerate both inputs in one clean build (cargo clean) and re-run the split","Verify you pass the rustc-emitted module and the wasm-bindgen output from the same target directory and build","Align dx, wasm-bindgen and dioxus versions; prefer running via dx so the correct inputs are chosen"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before splitting, sanity-check the pairing exists (CLI wrapper):\nfn split_points_paired(module: &wasm_encoder_module_repr) -> bool {\n    // for every import __wasm_split_00___*___00_import_*\n    // assert an export __wasm_split_00___<mod>___00_export_<hash>_<fn> exists\n    imports_starting_with(\"__wasm_split_00___\")\n        .all(|imp| exports_contain(&paired_export_name(&imp)))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always feed wasm-split-cli the original and bindgened wasm from the same build directory","Regenerate both files with cargo clean after any toolchain or dioxus upgrade","Prefer running splitting through dx rather than manual CLI invocations"],"tags":["wasm-split","wasm","build","cli","artifact-mismatch","panic"],"backgroundTag":null,"analyzedSha":"393d190a801ccb441d41923e232289b4f8a5c669","analyzedAt":"2026-08-16T11:27:45.815Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}