You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my rust-analyzer setup, I have cargo.allFeatures set to true, so I can see warnings that occur in my server only code.
Problem is now I don't see warnings that only happen when building the wasm code. Any ideas on how to deal with this?
As as example, if I have the following code:
use xyz
use dioxus::prelude::*;#[server]pubasyncfndo_something() -> Result<(),ServerFnError>{
xyz::do_it();}
This is fine when compiling for the server, but when compiling for the wasm target I get the warning that xyz is undefined. I typically don't see these warnings most of the time either, because dx tends to hide them.
Any ideas how to solve this warning? I don't particularly want to turn off unused import warnings.
I guess I could move the imports to inside the server function. Or prefix the imports with #[cfg(feature = "server")]. But wondering if there is any other solution.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
In my rust-analyzer setup, I have
cargo.allFeatures
set to true, so I can see warnings that occur in my server only code.Problem is now I don't see warnings that only happen when building the wasm code. Any ideas on how to deal with this?
As as example, if I have the following code:
This is fine when compiling for the server, but when compiling for the wasm target I get the warning that
xyz
is undefined. I typically don't see these warnings most of the time either, because dx tends to hide them.Any ideas how to solve this warning? I don't particularly want to turn off unused import warnings.
I guess I could move the imports to inside the server function. Or prefix the imports with
#[cfg(feature = "server")]
. But wondering if there is any other solution.Thanks
Beta Was this translation helpful? Give feedback.
All reactions