Stream: wit-bindgen

Topic: ✔ Could not find `__export_world_example_cabi`


view this post on Zulip Bozhidar Manev (Sep 17 2024 at 13:58):

Hi, this error comes when trying to use the export! macro with or without "with_types_in self".

error[E0433]: failed to resolve: could not find `__export_world_example_cabi` in the crate root
  --> component/src/bindings.rs:90:35
   |
90 | ...o_types_root)*:: __export_world_example_cabi!($ty with_types_in
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ could not find `__export_world_example_cabi` in the crate root
   |
  ::: component/src/lib.rs:14:1
   |
14 | bindings::export!(Compoenent with_types_in self);
   | ------------------------------------------------ in this macro invocation
   |

Without the macro the build throws :

error: failed to decode world from module
Caused by:
    0: module was not valid
    1: module does not export required function `register`

where register is an exported function in the .wit file

view this post on Zulip Alex Crichton (Sep 17 2024 at 14:58):

I think you'll need to change with_types_in self to with_types_in bindings because that's the root of the generated bindings

view this post on Zulip Bozhidar Manev (Sep 17 2024 at 15:08):

Thank you. I just generated a simple component and saw it there

view this post on Zulip Notification Bot (Sep 17 2024 at 15:09):

Bozhidar Manev has marked this topic as resolved.


Last updated: Dec 23 2024 at 12:05 UTC