Closed kwiat1990 closed 9 months ago
I'm not able to reproduce this with
cargo leptos new --git leptos-rs/start-axum
cargo leptos build
I can confirm I am having the same issue but the version of leptos_dom is 0.5.4 in my case. I've tried using both nightly and stable rust but could not solve this. Rust versions all updated and cargo-leptos updated to latest. Running on Windows 11. Happy to provide more details if it helps solve this bug. I really like the full stack idea and I think this is the bread and butter of where Leptos shines.
@th3oth3rjak3 Like I said, I cannot reproduce this by creating a fresh project using this template. Have you made any changes to the starter that led to this issue? If so, sharing a reproduction or a diff relative to the template is useful.
@gbj I think I figured out the problem and this could explain why the other template which uses a workspace doesn't have the issue. When I first loaded up the template, I was getting VSCode messages and the text was graying out because of the cfg macros. Thinking there was an issue, I did cargo add leptos --features ssr
and cargo add leptos --features hydrate
. This updated the Cargo.toml file which now (incorrectly) had extra features specified right next to the "nightly" feature on line 14. Once I removed those the app ran fine. I think all of these things are covered in the docs, but I didn't put two and two together because when I read the part about the Rust-Analyzer in the docs, I hadn't really even tried making a template yet and was still just interested in learning the syntax of the framework. I think maybe a section in the docs that describe the best way to add dependencies to the cargo.toml file would be helpful and maybe even a reminder in the template README about the Rust-Analyzer gray-out problem and a workaround.
Bottom line is that I don't think this is a bug, but I do think it is something that might trip people up from time to time. I did end up using the README to add the additional packages (lines 39-46) and that was very helpful. Thanks for all you do!
@gbj I think I figured out the problem and this could explain why the other template which uses a workspace doesn't have the issue. When I first loaded up the template, I was getting VSCode messages and the text was graying out because of the cfg macros. Thinking there was an issue, I did
cargo add leptos --features ssr
andcargo add leptos --features hydrate
. This updated the Cargo.toml file which now (incorrectly) had extra features specified right next to the "nightly" feature on line 14. Once I removed those the app ran fine. I think all of these things are covered in the docs, but I didn't put two and two together because when I read the part about the Rust-Analyzer in the docs, I hadn't really even tried making a template yet and was still just interested in learning the syntax of the framework.
Yeah fair enough. The mutually exclusive feature flags are a real pain point, for many reasons, and I'm trying to remove them in as many places as possible for the next release. Sorry they bit you here.
I have downloaded
start-axum
template today and executed setup all commands listed inREADME
file but after that while runningcargo leptos watch
I get following errors and the app doesn’t show up in the browser:On the other hand
start-axum-workspace
works fine and compiles without errors.