I get the following error when trying to load a component.
Error: import `aerugo:wm/types` has the wrong type
Caused by:
0: instance export `toplevel` has the wrong type
1: expected resource found nothing
However I see there is a pre_instantiate
and add_to_linker
function. I'm guessing these need to be used given I only call instantiate at hte moment:
tracing::trace!("Creating component");
let component = wasmtime::component::Component::new(&engine, bytes)?;
let linker = Linker::new(&engine);
// TODO: Tune the fuel amount
store.add_fuel(10000).unwrap();
tracing::trace!("Instantiate component");
let (aerugo_wm, instance) = host::AerugoWm::instantiate(&mut store, &component, &linker)?;
You'll need to use generated add_to_linker
functions to insert the imports into the Linker
you create there
Yep the add_to_linker and pre_instantiate seem to get past there
Hmm new question then: I seem to get errors on exports.instance()?
let mut export_wm = exports.instance("wm-types").expect("Handle missing wm export");
let funcs = WmTypes::new(&mut export_wm)?;
The world has this:
world aerugo-wm {
export wm-types
}
Hmm use .root() I guess
i509VCB has marked this topic as resolved.
Last updated: Dec 23 2024 at 13:07 UTC