What is the support scope of Wasmtime's async component for different string encodings?
I have a WIT file as follows:
package my:test;
interface i {
ping: async func(x: future<string>, y: string) -> future<string>;
}
world test {
export i;
}
world runner {
import i;
}
When using wasm-tools component embed, if the string-encoding parameters are different, it seems to trigger an invalid error during task.return. Specifically, because the parameter y is of type string, the embed operation encodes the async lift. However, if the string-encoding of test and runner differs, it causes an issue at this point (as seen in this code line).
non-utf8 encodings aren't super well tested right now, so while wasmtime should have support for everything this is likely a guest toolchain issue unable to produce the correct component. Could you file an issue with a reproduction? That'll help narrow down where the bug lies and we can transfer it to the right repo once the source is found
Yes, I agree. This issue cannot be reproduced with the wat files generated by wasm-tools embed --dummy-names legacy --async-callback (I've tried many methods but all failed). However, the wat code generated by wit-bindgen is too lengthy. I'm currently thinking about how to minimize the error case before submitting an issue.
it's ok if it's not the most minimal thing in the world, we can help minimize too once we can repro
Last updated: Dec 06 2025 at 05:03 UTC