{"record":{"id":"242ffc5aaf14296a","repo":"DioxusLabs/dioxus","slug":"failed-to-expand-ifunc-table","errorCode":null,"errorMessage":"failed to expand ifunc table","messagePattern":"failed to expand ifunc table","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/wasm-split/wasm-split-cli/src/lib.rs","lineNumber":411,"sourceCode":"    /// be filled in from the loaded split module.\n    ///\n    /// This is because these imports are going to be delayed until the split module is loaded\n    /// and loading in the main module these as imports won't be possible since the imports won't\n    /// be resolved until the split module is loaded.\n    fn create_ifunc_table(&self, out: &mut Module) {\n        let ifunc_table = self.load_funcref_table(out);\n        let dummy_func = self.make_dummy_func(out);\n\n        out.exports.add(\"__indirect_function_table\", ifunc_table);\n\n        // Expand the ifunc table to accommodate the new ifuncs\n        let segment_start = self\n            .expand_ifunc_table_max(\n                out,\n                ifunc_table,\n                self.split_points.len() + self.shared_symbols.len(),\n            )\n            .expect(\"failed to expand ifunc table\");\n\n        // Delete the split import functions and replace them with local functions\n        //\n        // Start by pushing all the shared imports into the list\n        // These don't require an additional stub function\n        let mut ifuncs = vec![];\n\n        // Push the split import functions into the list - after we've pushed in the shared imports\n        for idx in 0..self.split_points.len() {\n            // this is okay since we're in the main module\n            let import_func = self.split_points[idx].import_func;\n            let import_id = self.split_points[idx].import_id;\n            let ty_id = out.funcs.get(import_func).ty();\n            let stub_idx = segment_start + ifuncs.len();\n\n            // Replace the import function with a local function that calls the indirect function\n            out.funcs.get_mut(import_func).kind =\n                self.make_stub_funcs(out, ifunc_table, ty_id, stub_idx as _);","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/393d190a801ccb441d41923e232289b4f8a5c669/packages/wasm-split/wasm-split-cli/src/lib.rs#L393-L429","documentation":"During wasm splitting, split and shared functions are routed through an indirect function (funcref) table. expand_ifunc_table_max grows that table by split_points+shared_symbols entries but returns None — triggering this panic — when the funcref table has no declared maximum to grow from.","triggerScenarios":"Running the wasm-split step (dx build/serve for web with wasm splitting enabled) on a wasm-bindgen output whose funcref table lacks a maximum field — typically produced by a mismatched rustc/wasm-bindgen/dx toolchain combination, or a module never intended for splitting.","commonSituations":"Toolchain version skew after upgrading dx or the wasm toolchain without a clean rebuild; custom build pipelines feeding foreign wasm modules into wasm-split-cli.","solutions":["Update dioxus-cli (dx), wasm-bindgen and rustc to versions known to work together, then rebuild","cargo clean and rebuild so wasm-bindgen regenerates the module with a proper table maximum","If it persists, disable wasm code splitting (dx config / web feature) until toolchains align","When invoking wasm-split-cli manually, feed the exact rustc + wasm-bindgen outputs from a single build"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Upgrade dx, wasm-bindgen, and rustc as a set; avoid mixing nightly/stable toolchains","cargo clean after toolchain or dx upgrades before enabling wasm-split builds","Disable wasm splitting when experimenting with unusual toolchains; re-enable once versions align","When automating wasm-split-cli, verify the module comes from the current build"],"tags":["wasm-split","wasm","build","cli","toolchain","panic"],"backgroundTag":null,"analyzedSha":"393d190a801ccb441d41923e232289b4f8a5c669","analyzedAt":"2026-08-16T11:27:45.815Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}