-
Notifications
You must be signed in to change notification settings - Fork 774
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 compilation not working #1824
Comments
for some reason tokio is pulled in if you directly depend on ethers. however I've checked all default features and tokio usage in all subcrates which should be ignored for the wasm target, however iirc there are some issues with mutually exclusive |
This is still reproducible if you have
And then try to cargo build -p ethers-wasm --target wasm32-unknown-unknown This will try to compile ~70 additional targets and in the end produces the same huge list of errors related to Probably caused by https://nickb.dev/blog/cargo-workspace-and-the-feature-unification-pitfall/ |
Running into the similar issue here. Our project has one crate for smart contracts where it contains foundry-generated contract bindings, and another crate which uses those bindings and compiles to wasm with wasm-bindgen. The same sets of errors related to mio are reported when running cargo build. |
As a workaround you can move wasm crate into a subworkspace via adding [workspace]
# nothing here to the bottom of its |
Version
1.0.0
Description
WASM compilation currently only works if you compile the example in
examples/ethers-wasm
while its still inside the main ethers-rs repo. If you copy the entire contents of the folder somewhere else, compilation will fail with dozens of errors relating to the meo crate (I think it is a dependency of tokio). It seems that any crate the imports ethers-rs fails this way when compiling to wasm in my testing.Here is what the errors look like: https://pastebin.com/BwcEi9Zk
The text was updated successfully, but these errors were encountered: