Open KhaledHosseini opened 3 months ago
I have asked benwise to take a look at this issue. As I have no idea why this is occurring. But from the Error, it seems to be some issue with Mio? Are you using Axum with Leptos? If not, my Session library will not currently work for anything but Axum. I have been planning to expand access to other systems that Leptos supports, but have not found the time to get around to it yet.
I have asked benwise to take a look at this issue. As I have no idea why this is occurring. But from the Error, it seems to be some issue with Mio? Are you using Axum with Leptos? If not, my Session library will not currently work for anything but Axum. I have been planning to expand access to other systems that Leptos supports, but have not found the time to get around to it yet.
Yes, I use axum. I created my project using: cargo leptos new --git leptos-rs/start-axum
.
For anyone who comes up with this problem, you can solve it by making the crate optional inside leptos project Cargo.toml. many crates have limited WASM support and you need to make them optional and only enable them in the server feature(ssr). so instead of
axum_session = { version = "0.14.0", features = ["advanced"] }
axum_session_auth = { version = "0.14.0", features = ["advanced"]}
axum_session_sqlx = { version= "0.1.0"}
use the following: (add optional=true):
axum_session = { version = "0.14.0", features = ["advanced"], optional = true }
axum_session_auth = { version = "0.14.0", features = ["advanced"], optional = true}
axum_session_sqlx = { version= "0.1.0", optional = true}
[features]
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate"]
ssr = [
"dep:axum",
"dep:tokio",
"dep:sqlx",
"dep:axum_session",
"dep:axum_session_auth",
"dep:axum_session_sqlx",
"dep:tower",
"dep:tower-http",
"dep:leptos_axum",
"leptos/ssr",
"leptos_meta/ssr",
"leptos_router/ssr",
"dep:tracing",
]
ahh so that was the issue. Thank you for letting us know. We will leave this Open for other people to See the answer too.
when it is added to leptos project, and after running cargo leptos watch, the following error rises:
Any suggestion on how to resolve this?