Closed LordGaav closed 2 months ago
Change the Settings for thaw to the following:
tracing = { version = "0.1", optional = true }
http = "1"
thaw = "0.3.0"
[features]
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate", "thaw/hydrate"]
ssr = [
"dep:axum",
"dep:tokio",
"dep:tower",
"dep:tower-http",
"dep:leptos_axum",
"leptos/ssr",
"leptos_meta/ssr",
"leptos_router/ssr",
"dep:tracing",
"thaw/ssr",
]
That seems to work :+1:
What part was the solution? Not installing the ssr feature of thaw? Why does that help in this case?
CSR, SSR and hydrate are mutually exclusive, I guess your previous configuration was the following:
tracing = { version = "0.1", optional = true }
http = "1"
thaw = { version = "0.3.0", features = ["ssr"] }
[features]
hydrate = ["leptos/hydrate", "leptos_meta/hydrate", "leptos_router/hydrate", "thaw/hydrate"]
ssr = [
"dep:axum",
"dep:tokio",
"dep:tower",
"dep:tower-http",
"dep:leptos_axum",
"leptos/ssr",
"leptos_meta/ssr",
"leptos_router/ssr",
"dep:tracing",
"thaw/ssr",
]
The SSR is enabled by default on Thaw configuration.
When cargo leptos watch
is executed, the following action is performed:
cargo build ... --target=wasm32-unknown-unknown --no-default-features --features=hydrate
cargo-leptos helps you turn on hydrate feature again, SSR and hydrate are turned on at the same time, there will be problems.
Ah, now I understand the purpose of the [features]
block. Thanks for the help :ok_hand:
I'm trying to follow along with the examples, and I can't get
cargo leptos watch
to run when addingthaw
. This is my entire log to reproduce the problem on my system:I've tried running the example with nightly rust (the default from
cargo leptos new
), stable rust. I also tried installing-F hydrate,ssr
. Addingthaw/ssr
andthaw/hydrate
to the[features]
section also doesn't seem to help. Removing thaw withcargo remove thaw
immediately fixes the above errors.I'm stumped, am I doing something wrong or am I running into a bug?