Git Product home page Git Product logo

Comments (2)

yskopets avatar yskopets commented on July 18, 2024 1

Hey @jeremybaumont,

Thanks for giving it a try!

Apparently, the error message is misleading.

When I run this example with the logging level set to trace, I see the following output:

getenvoy extension run --envoy-options '--component-log-level wasm:trace'

...
[debug][wasm] [bazel-out/darwin-opt/bin/external/envoy/source/extensions/common/wasm/_virtual_includes/wasm_hdr/extensions/common/wasm/wasm_vm.h:45] WasmVm created envoy.wasm.runtime.v8 now active
[debug][wasm] [external/envoy/source/extensions/common/wasm/wasm.cc:106] Base Wasm created 1 now active
[trace][wasm] [external/envoy/source/extensions/common/wasm/wasm_vm.cc:23] Failed to load Wasm module due to a missing import: __wbindgen_placeholder__.__wbindgen_describe
[trace][wasm] [external/envoy/source/extensions/common/wasm/wasm_vm.cc:23] Failed to load Wasm module due to a missing import: __wbindgen_externref_xform__.__wbindgen_externref_table_grow
[trace][wasm] [external/envoy/source/extensions/common/wasm/wasm_vm.cc:23] Failed to load Wasm module due to a missing import: __wbindgen_externref_xform__.__wbindgen_externref_table_set_null
[trace][wasm] [external/envoy/source/extensions/common/wasm/wasm_vm.cc:23] Failed to load Wasm module due to a missing import: __wbindgen_placeholder__.__wbindgen_throw
[error][wasm] [external/envoy/source/extensions/common/wasm/wasm.cc:123] Wasm VM failed Wasm missing malloc
[error][wasm] [external/envoy/source/extensions/common/wasm/wasm.cc:123] Wasm VM failed Failed to initialize Wasm code
[debug][wasm] [external/envoy/source/extensions/common/wasm/wasm.cc:164] ~Wasm 0 remaining active
[debug][wasm] [bazel-out/darwin-opt/bin/external/envoy/source/extensions/common/wasm/_virtual_includes/wasm_hdr/extensions/common/wasm/wasm_vm.h:49] ~WasmVm envoy.wasm.runtime.v8 0 remaining active
[trace][wasm] [external/envoy/source/extensions/common/wasm/wasm.cc:360] Unable to create Wasm
[critical][main] [external/envoy/source/server/server.cc:101] error initializing configuration '/private/var/folders/zq/dxlbtftx6bd2rfdgs2l6fhc00000gn/T/getenvoy_extension_run284847362/envoy.tmpl.yaml': Unable to create Wasm HTTP filter me.filters.http.envoy_digest_header_filter
[info][main] [external/envoy/source/server/server.cc:704] exiting
Unable to create Wasm HTTP filter me.filters.http.envoy_digest_header_filter

Notice error messages Failed to load Wasm module due to a missing import: __wbindgen_ ...

As far as I can see, you've added dependency on ring v0.16.15 which transitively brings in dependency on wasm-bindgen v0.2.68.

cargo tree --target wasm32-unknown-unknown

...
│   ├── ring v0.16.15
│   │   ├── untrusted v0.7.1
│   │   └── web-sys v0.3.45
│   │       ├── js-sys v0.3.45
│   │       │   └── wasm-bindgen v0.2.68
│   │       │       ├── cfg-if v0.1.10
│   │       │       └── wasm-bindgen-macro v0.2.68
│   │       │           ├── quote v1.0.7
│   │       │           │   └── proc-macro2 v1.0.24
│   │       │           │       └── unicode-xid v0.2.1
│   │       │           └── wasm-bindgen-macro-support v0.2.68
│   │       │               ├── proc-macro2 v1.0.24 (*)
│   │       │               ├── quote v1.0.7 (*)
│   │       │               ├── syn v1.0.45
│   │       │               │   ├── proc-macro2 v1.0.24 (*)
│   │       │               │   ├── quote v1.0.7 (*)
│   │       │               │   └── unicode-xid v0.2.1
│   │       │               ├── wasm-bindgen-backend v0.2.68
│   │       │               │   ├── bumpalo v3.4.0
│   │       │               │   ├── lazy_static v1.4.0
│   │       │               │   ├── log v0.4.11
│   │       │               │   │   └── cfg-if v0.1.10
│   │       │               │   ├── proc-macro2 v1.0.24 (*)
│   │       │               │   ├── quote v1.0.7 (*)
│   │       │               │   ├── syn v1.0.45 (*)
│   │       │               │   └── wasm-bindgen-shared v0.2.68
│   │       │               └── wasm-bindgen-shared v0.2.68
│   │       └── wasm-bindgen v0.2.68 (*)
│   │   [build-dependencies]
│   │   └── cc v1.0.61

wasm-bindgen is meant for a browser environment. It relies on __wbindgen_ ... functions provided by the host environment, which is not the case for Envoy.

I don't know why ring v0.16.15 needs wasm-bindgen. I would suggest to check documentation of that library whether wasm-bindgen is optional.

from envoy-wasm-rust-sdk.

jeremybaumont avatar jeremybaumont commented on July 18, 2024 1

Thanks, I understand. I got ride off ring crate, and it works fine now. Thanks for the quick answer 😄

from envoy-wasm-rust-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.