{"record":{"id":"b1b53bd50af0a87e","repo":"wasmerio/wasmer","slug":"internal-error-failed-to-resolve-exported-functio-b1b53b","errorCode":null,"errorMessage":"Internal error: failed to resolve exported function {name}: {e:?}","messagePattern":"Internal error: failed to resolve exported function (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lib/wasix/src/state/linker/instance_group/table.rs","lineNumber":151,"sourceCode":"        &self,\n        store: &mut impl AsStoreMut,\n        name: &str,\n        resolved_from: ModuleHandle,\n        function_table_index: u32,\n    ) -> Result<(), LinkError> {\n        trace!(\n            ?name,\n            ?resolved_from,\n            function_table_index,\n            \"Applying resolved function\"\n        );\n\n        let instance = &self.try_instance(resolved_from).unwrap_or_else(|| {\n            panic!(\"Internal error: module {resolved_from:?} not loaded by this group\")\n        });\n\n        let func = instance.exports.get_function(name).unwrap_or_else(|e| {\n            panic!(\"Internal error: failed to resolve exported function {name}: {e:?}\")\n        });\n\n        self.place_in_function_table_at(store, func.clone(), function_table_index)\n            .map_err(LinkError::TableAllocationError)?;\n\n        Ok(())\n    }\n\n    pub(super) fn apply_function_table_allocation(\n        &mut self,\n        store: &mut impl AsStoreMut,\n        index: u32,\n        size: u32,\n    ) -> Result<(), LinkError> {\n        trace!(index, \"Applying function table allocation\");\n        let allocated_index = self\n            .allocate_function_table(store, size, 0)\n            .map_err(LinkError::TableAllocationError)? as u32;","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/wasmerio/wasmer/blob/8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5/lib/wasix/src/state/linker/instance_group/table.rs#L133-L169","documentation":"apply_resolved_function found the instance for resolved_from, but querying instance.exports.get_function(name) failed; the module does not actually export a function with that name (or it is exported with a different kind). The panic surfaces the underlying lookup error e. This means the resolution table and the module's real export surface disagree.","triggerScenarios":"apply_requested_symbols_from_linker / apply_dl_operation resolving symbol {name} to module X, then X's exports contain no function named {name}; export kind mismatch (name exported as a global/memory instead of a function).","commonSituations":"Version skew: a shared library was rebuilt and dropped/renamed an exported symbol; symbol name mangling or version-script changes; resolution state built against a different build of the module than the one instantiated.","solutions":["Rebuild the consuming module and the shared library together so resolved symbol names match actual exports (nm/wasm-objdump the exports)","Check that the symbol is exported as a function (not a global) in the provider module","Clear stale linker/resolution state and re-run the link after replacing a module build","If the export exists with the right kind yet the panic persists, report as a linker bug with the module and symbol name"],"exampleFix":"// before: lib rebuilt without the export\n//   resolution says libfoo exports 'callback', but new build exports 'cb'\ngroup.apply_resolved_function(store, libfoo_handle, \"callback\", idx);\n// after: keep ABI stable or re-resolve against new names\n//   export 'callback' in the rebuilt lib, or update the resolution for 'cb'","handlingStrategy":"validation","validationCode":"fn exports_function(inst: &Instance, name: &str) -> bool {\n    inst.exports.get_function(name).is_ok()\n}\n// before apply_resolved_function:\nassert!(exports_function(&group.try_instance(handle).unwrap(), \"callback\"));","typeGuard":"fn is_exported_function(inst: &Instance, name: &str) -> bool {\n    inst.exports.get_function(name).is_ok()\n}","tryCatchPattern":null,"preventionTips":["Rebuild consumers and providers together so exports match resolutions","Verify the symbol is exported as a function with nm/wasm tools","Invalidate resolution state when swapping module builds","Keep exported ABI stable (no silent renames/removals)"],"tags":["linker","missing-export","symbol-resolution","panic"],"backgroundTag":"missing-wasm-export","analyzedSha":"8c4b9ee9d33fb2068863fbb3d328683e7e6ff7f5","analyzedAt":"2026-09-01T23:06:31.009Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}