proxy-wasm-rust-sdk
proxy-wasm-rust-sdk copied to clipboard
WASM module built through Proxy-wasm RUST SDK can't be loaded due to missing imports: due to a missing import: __wbindgen_externref_xform__.__wbindgen_externref_table_grow
Reproduce steps:
-
Git clone the following WASM/RUST sample project: https://github.com/otomato-gh/proxy-wasm-rust
-
In the Cargo.toml file, add a 'reqwest' depedency [dependencies] reqwest = { version = "0.10" }
-
In src/lib.rs file, add: use reqwest::Client;
and in the on_http_request_headers(...) method body: let _client = Client::new();
-
Build WASM using: cargo build --target=wasm32-unknown-unknown --release
-
Start Istio-proxy using docker-compose: docker-compose up --build
You will see the following error complaining:
[2020-08-21 18:49:31.113][6][critical][main] [external/envoy/source/server/server.cc:98] error initializing configuration '/etc/envoy.yaml': Failed to load WASM module due to a missing import: __wbindgen_externref_xform__.__wbindgen_externref_table_grow
Hi @marklu2018
Do you resolve this issue? If yes, could you please share for me information.
Thanks
You aren't expected to use reqwest (which I suspect is the source of bindgen the issue) to make outgoing calls, this SDK provides dedicated functions to do that (dispatch_http_call, see: examples/http_auth_random.rs).
Hi, @marklu2018 @thinhtranquoc Do you resolve this issue? If yes, could you please share for me information.
Thanks