proxy-wasm-rust-sdk icon indicating copy to clipboard operation
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

Open marklu2018 opened this issue 5 years ago • 3 comments

Reproduce steps:

  1. Git clone the following WASM/RUST sample project: https://github.com/otomato-gh/proxy-wasm-rust

  2. In the Cargo.toml file, add a 'reqwest' depedency [dependencies] reqwest = { version = "0.10" }

  3. In src/lib.rs file, add: use reqwest::Client;

and in the on_http_request_headers(...) method body: let _client = Client::new();

  1. Build WASM using: cargo build --target=wasm32-unknown-unknown --release

  2. 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

marklu2018 avatar Aug 21 '20 18:08 marklu2018

Hi @marklu2018

Do you resolve this issue? If yes, could you please share for me information.

Thanks

thinhtranquoc avatar Sep 10 '21 07:09 thinhtranquoc

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).

PiotrSikora avatar Sep 10 '21 09:09 PiotrSikora

Hi, @marklu2018 @thinhtranquoc Do you resolve this issue? If yes, could you please share for me information.

Thanks

bestgopher avatar Jul 11 '22 09:07 bestgopher