-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#[wasm-bindgen] macro does not work for extern functions not in the root of the crate #159
Comments
Additional finding: it doesn't seem to matter whether the function is in another file, per se, only that it's in another module. Anyway, I got my main project by moving the (relatively few) js imports into the root. |
I ran into the same problem, the catch seems to be that |
Thank you! That fixed it! 🙌 |
Ah yeah this is an unfortunate limitation of wasm-bindgen right now. This has to do with the weird details of symbol visibility in rustc, but @jsheard's solution is indeed the best option for now. Now long-term I think that's definitely not a great solution and we'll probably want toexplore different options, but I'm not sure what to do differently at this time :( |
Hello. Thank you so much for your help these past two weeks.
So, as of today (perhaps due to upgrading to the latest nightly, I don't know), wasm-bindgen does not seem to work for extern functions not in the root of the crate. I have the following in the root of my crate:
and the following in
js.rs
If I uncomment that block in the root of the crate, everything compiles, whether or not the
pub fn set_timeout
is uncommented in js.rs. However, if the block in the root of the crate is commented, and the function injs.rs
is uncommented (and only then), do I get the following error:I'm running these commands:
versions, etc:
Thank you so much!
The text was updated successfully, but these errors were encountered: