Open albert-queralto opened 6 months ago
I had a similar issue, switching the to wasm version 0.2.89 in the Cargo.toml
file and disabling the metal
feature in Cargo.toml
worked for me.
Hi @darrenkim247, I tried your suggestion and now I am getting the following error when compiling:
error[E0433]: failed to resolve: use of undeclared crate or module `futures`
--> src/app.rs:4:5
|
4 | use futures::stream::SplitSink;
| ^^^^^^^ use of undeclared crate or module `futures`
error[E0432]: unresolved import `futures`
--> src/app.rs:27:9
|
27 | use futures::{SinkExt, StreamExt};
| ^^^^^^^ use of undeclared crate or module `futures`
error[E0599]: no method named `split` found for struct `gloo_net::websocket::futures::WebSocket` in the current scope
--> src/app.rs:39:45
|
39 | let (sender, mut recv) = connection.split();
| ^^^^^ method not found in `WebSocket`
|
::: /home/albert/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/stream/stream/mod.rs:1582:8
|
1582 | fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)
| ----- the method is available for `gloo_net::websocket::futures::WebSocket` here
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
1 + use futures_util::stream::stream::StreamExt;
|
Some errors have detailed explanations: E0432, E0433, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `rusty_llama` (lib) due to 3 previous errors
The strange thing is that the futures module is present in the cargo.toml file. Any ideas?
You might have to remove the 'optional' tag from the futures module present in Cargo.toml. Afterwards, remove "futures" as a dependency in csr, hydrate, or ssr
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see https://github.com/rust-lang/cargo/issues/6313.
Compiling rusty_llama v0.1.0 (C:\Users\ASUS ExpertBook\source\repos\rusty_llama)
error[E0432]: unresolved import api::ws
--> src/main.rs:3:5
|
3 | use api::ws;
| ^^^^^^^ no ws
in api
For more information about this error, try rustc --explain E0432
.
error: could not compile rusty_llama
(bin "rusty_llama") due to 1 previous error
I get this error, so how I can fix it :_(
The targets should have unique names. Consider changing their names to be unique or compiling them separately. This may become a hard error in the future; see rust-lang/cargo#6313. Compiling rusty_llama v0.1.0 (C:\Users\ASUS ExpertBook\source\repos\rusty_llama) error[E0432]: unresolved import
api::ws
--> src/main.rs:3:5 | 3 | use api::ws; | ^^^^^^^ nows
inapi
For more information about this error, try
rustc --explain E0432
. error: could not compilerusty_llama
(bin "rusty_llama") due to 1 previous errorI get this error, so how I can fix it :_(
I got rid of this error by removing the use api::ws
. I did change tokio dependancy to tokio = { version = "1", features = ["full"] }
aswell so that may have done something as well, but not checked.
Hi, first of all nice work. I was wondering if you could lend me a hand, since I am experiencing and issue when trying to compile using cargo leptos watch. The error is the following:
Finished dev [unoptimized + debuginfo] target(s) in 44.24s Cargo finished cargo build --package=rusty_llama --lib --target-dir=/home/albert/Desktop/llama-rust/target/front --target=wasm32-unknown-unknown --no-default-features --features=hydrate Front compiling WASM Error: at
/home/albert/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-leptos-0.2.17/src/compile/front.rs:47:30`Caused by: 0: at
/home/albert/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-leptos-0.2.17/src/compile/front.rs:122:10
1:I have tried with both options, using
cargo update -p wasm-bindgen --precise 0.2.92
andcargo install -f wasm-bindgen-cli --version 0.2.89
, but it doesn't seem to work. Any ideas?Thank you very much